Bloomberg Interview Question

Tech question1 : Linkedlist cycle. Find if there is a cycle in one linkedlist.

Interview Answer

Anonymous

Aug 14, 2017

bool hasCycle(Node *head) { vector visitedNode; Node *currentPos = head; while(currentPos != NULL) { for(int i = 0; i next; } return false; }