Re: Data Structure/Algorithm Challenger II
some hint please. isnt the one by single linked list considered to be the most optimal?i jus hav a vague idea.may be we can have two pointers that go in opposite directions and if they dont meet means there is a cycle.i dont know where my second pointer ie which is to travel back wards has to point initially because i am not given the number of nodes.
|