Re: [algogeeks] Re: Circular list

2011-07-22 Thread Pankaj
That can never be done in constant time :). If you can find one solution, then please let us know. On Sat, Jul 23, 2011 at 1:13 AM, rShetty wrote: > SO what about If my Linked list is a sorted list and the new node I > wanna insert must maintain that sorted nature , So can then be the > insertio

Re: [algogeeks] Re: Circular list

2011-07-22 Thread vaibhav shukla
i think for sorted order. u hv to traverse the list.it cant be in const time On Sat, Jul 23, 2011 at 1:13 AM, rShetty wrote: > SO what about If my Linked list is a sorted list and the new node I > wanna insert must maintain that sorted nature , So can then be the > insertion of a node be done in

[algogeeks] Re: Circular list

2011-07-22 Thread rShetty
SO what about If my Linked list is a sorted list and the new node I wanna insert must maintain that sorted nature , So can then be the insertion of a node be done in constant time without traversing the list ?? On Jul 23, 12:26 am, Pankaj wrote: > If you know circular list, what is avoiding you f

[algogeeks] Re: Circular list

2011-07-22 Thread rShetty
So we should maintain a tail pointer and add nodes next to the tail pointer ??? Right ??? On Jul 23, 12:26 am, Pankaj wrote: > If you know circular list, what is avoiding you from maintaining a tail > pointer. > You just need to tweak insert and delete function a little bit for corner > cases. >

Re: [algogeeks] Re: Circular list

2011-07-22 Thread Pankaj
If you know circular list, what is avoiding you from maintaining a tail pointer. You just need to tweak insert and delete function a little bit for corner cases. On Sat, Jul 23, 2011 at 12:50 AM, rShetty wrote: > Algorithm Please ... Thank You > > On Jul 23, 12:17 am, vaibhav shukla wrote: > >

[algogeeks] Re: Circular list

2011-07-22 Thread rShetty
Algorithm Please ... Thank You On Jul 23, 12:17 am, vaibhav shukla wrote: > maintain just a tail pointer > > On Sat, Jul 23, 2011 at 12:45 AM, rShetty wrote: > > Come Up with an Algorithm to implement the insertion of a node in > > circular linked list without actually traversing the list ?