Pergunta de entrevista da empresa UBS

Linked list in java is singly or doubly, why doubly and not singly, write prog to detect loop in linked list

Resposta da entrevista

Sigiloso

24 de set. de 2018

we can use set/hash to add elements to find duplicate one or we can use length, if looping exceeds length it is possibly a loop, we cannot compare 2 elements in the linked list, as the same element can be present twice, he was expecting Floyd’s algo which I was not aware of at the time.