DATA STRUCTURE INTERVIEW QUESTION & ANSWERS
Technical
Follow Us
61. | What is linked list? |
---|---|
A linked list is a set of nodes where each node has two fields data and a link. Where data fields stores the actual piece of information and link field is used to point to next node. |
62. | What are the types of linked list? |
---|---|
There are various types of linked lists such as
|
63. | What is the advantage of circular linked list? |
---|---|
In the circular linked list the next pointer of the last node points to the first node of the linked list. So one can quickly access the first node when he is accessing the last node, which in turn improves the efficiency of the algorithm as compared to the singly linked list. |
64. | How to represent a string? |
---|---|
A string can be represented using an array or a linked list. A string of characters having length n can be implemented by a one dimentional array of n elements where the element of the array stores the character of the string. |
65. | What are the three ways to traverse a binary tree? |
---|---|
The traversal order in in–order is L–M–R; pre order is M–L–R; and post order is L–R–M. |