I have an unsorted sorted queue (undefined size).
bit [31:0] addr_q [$]
How can I find its maximum value?
SystemVerilog has a number array querying methods described in 7.12.1 Array locator methods of the 1800-2012 LRM. A queue is one kind of unpacked array. Use
max_addr = addr_q.max();