We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
Compare addresses between current node own address and current node pointing address. If the pointing address is less than current node own adress and the pointing address is not null then definitely it's pointing to a traversed node and return true otherwise return false. Because in data structure element's addresses are taken in accending order.
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Cycle Detection
You are viewing a single comment's thread. Return to all comments →
Compare addresses between current node own address and current node pointing address. If the pointing address is less than current node own adress and the pointing address is not null then definitely it's pointing to a traversed node and return true otherwise return false. Because in data structure element's addresses are taken in accending order.