Pergunta de entrevista da empresa Ciena

Difference btw Linked list and array Run time efficiencies for both . Accessing via linked list and Array. How to find weather a linked list has a loop?

Resposta da entrevista

Sigiloso

19 de nov. de 2012

So if you know the memory addresses that you are working with you can actually add the magnitude of the memory addresses that are being linked, so the 0xblahblah for each node and if the linked list is loop free it should be the sum of all the range of memory addresses used. If the sum is less than that, it loops, therefore it recreates a different total at the end.

3