Finding index of the negative value in Queue

In reply to Manoj J:

queue.find_first_index()

doesn’t return an index. It returns a queue that will either contain the desired index or be empty if no such index exists. What you’re printing is the “memory location” of the array. Change your format specifier to

%p

Also note that you’re printing queue[3] after doing max(), but the array only has 3 elements.