@Tayler : That's y i am using Java ArrayList instead of linked list where arrayList maintains element position.But problem is when an element is removed from the list,all subsequent elements to be moved forward........ Please check javadoc of arrayList : http://download.oracle.com/javase/6/docs/api/java/util/ArrayList.html
On Thu, Jul 28, 2011 at 11:58 AM, Tyler Durden <abhishek.khattr...@gmail.com > wrote: > @Rajeev: > How will you update the position of each element in the linked list after > removing a particular element? Won't you have to traverse the list > completely in which case your algo will be O(n^2) ?? > > -- > You received this message because you are subscribed to the Google Groups > "Algorithm Geeks" group. > To view this discussion on the web visit > https://groups.google.com/d/msg/algogeeks/-/Jylnk0KFxy0J. > > To post to this group, send email to algogeeks@googlegroups.com. > To unsubscribe from this group, send email to > algogeeks+unsubscr...@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/algogeeks?hl=en. > -- Thank You Rajeev Kumar -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en.