matt, the list may have a loop anywhere, ie from ANY intermediate element to ANY other previous element. the list may be of any length. i thought i had a solution to it but that too turned out to be quadratic (hashing).
hi i forgot to mention that in the linked list - only a head pointer is supplied to a linked list which is arbitrarily long. and the aim is to find out if it is looped ,in a more efficient manner - rather than by checking each pointer againsta all the other pointers which would be a quadratic...
hi i forgot to mention that in the linked list - only a head pointer is supplied to a linked list which is arbitrarily long. and the aim is to find out if it is looped ,in a more efficient manner - rather than by checking each pointer againsta all the other pointers which would be a quadratic...
hi i need to find a better way to determine if a linked list has a loop (anywhere ) - rather than by checking each pointer against all the others (which is a quadratic function). can some one please help??
longliz
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.