Friday, July 16, 2010

Give an algoritham for a singly linked circular list which reverses the direction of the lists?

Let P be a pointer to a circularly linked list.Show how this list may be used as a queue

Give an algoritham for a singly linked circular list which reverses the direction of the lists?
Are you for real? What college are you at? Back in my day when I went to school I had to walk uphill both ways. There was no bus! So seriously. Which question you want answered here?


First wikipedia:


http://en.wikipedia.org/wiki/Linked_list


Then 2 more tutorials:


http://www.inversereality.org/tutorials/...


http://www.cprogramming.com/tutorial/les...
Reply:Do your own homework. There are a great many resources on the web to help you with this.





A queue is a FIFO structure, which implies it is LILO as well. Think about it... a pointer to a circular list points to the first item in the list, so where is the LAST item in the list?
Reply:Man, have you tried doing your own homework? You'll get a lot more out of it.


No comments:

Post a Comment