Data Structures questions

Hello.
I need help with two programs.


1
2
3
4
5
6
7
8
9
10
11
12
13
14
        list<Bunny>mylist;
        //I'm not sure if this is right.
	list<Bunny>::iterator it;
        //And I'm not sure how to make the for loop.
	for (//...)
	{
                //The default constructor is generating random members, so I want to call it everytime.
		Bunny mybunny;
		mylist.push_back(mybunny);
	}
	for (//...)
	{
        //How do I call the Bunny's "print()" function?
	}

Also, is this list singly or doubly linked and how do I know that?



1
2
3
4
5
6
7
8
9
10
11
12
priority_queue<cure> MAX;

for (int i = 0; i < n; i++)
	{
			MAX.push(ss[i]);
	}

while (!MAX.empty())
		{
			MAX.top().print();
			MAX.pop();
		}


How to make a function to set the priority for the queue?

I discovered I don't need iterator for the first loop (of the first program). However, I still need help with the other problems. Any hints?
Topic archived. No new replies allowed.