Pregunta de entrevista de Snapdeal

find a loop in linked and write a code for "whether a BT is BST?". Algos for matrix manipulation...

Respuesta de la entrevista

Anónimo

20 ene 2015

Loop in Linked list: take two pointers one running in twice the speed as the other. If at any point they are equal it means there is loop in linked list. BT as BST: Iterate BT in in order fashion and see if the output is in ascending order.