InterviewSolution
| 1. |
How To Find The Length Of A Singly Linked List In Java? |
|
Answer» This is one of the easiest linked list questions you can expect in an interview. That's why it is often ASKED on telephonic interviews. In ORDER to find the length of linked list, you can iterate over linked list and keep a count of nodes until you REACH the end of the linked list where next NODE will be NULL. The value of the counter is the length of linked list. This is one of the easiest linked list questions you can expect in an interview. That's why it is often asked on telephonic interviews. In order to find the length of linked list, you can iterate over linked list and keep a count of nodes until you reach the end of the linked list where next node will be null. The value of the counter is the length of linked list. |
|