Hi.....
goal is to find the length of linked list...
there may be cycle in that....

my idea is directly trying to find the length instead of finding cycle and doing processing...to find length

traverse the list and hash the addresses..and increment the count untill either u find a null or same address hashed again....

this takes O(n) space complexity and O(n) time complexity...

we cant decrease time complexity to find the length.....
becoz we have to traverse every node...






On 7/21/06, Vinodh Kumar <[EMAIL PROTECTED]> wrote:
The loop is at the end as you have said.






--~--~---------~--~----~------------~-------~--~----~
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 [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/algogeeks
-~----------~----~----~----~------~----~------~--~---

Reply via email to