java - When do someone need to check for a linked list cycle ? -
java - When do someone need to check for a linked list cycle ? -
recently had interview java software developer , interviewer asked me some, according me, stupid questions. 1 of them if have e linked list how find if there cycle in linked list. question not how check cycle but, need real illustration when issue produced , when need check of list developing java web applications ?!
linked lists among simplest , mutual info structures. can used implement several other mutual abstract info types, including lists (the abstract info type), stacks, queues, associative arrays, , s-expressions, though not uncommon implement other info structures straight without using list basis of implementation.{wikipedia}
a malformed linked list loop causes infinite iteration on list fail because iteration never reach end of list. therefore, desirable able observe linked list malformed before trying iteration.so finding loop in linked list help avoid bugs , basic question computer science.you should knew it.
java data-structures
Comments
Post a Comment