Viva Questions for Data Structures Lab - DATA STR…
Viva Questions for Data Structures Lab - DATA STR…
Ans) A Data Structure is a data object together with the relationships that exists among the
instances & among the individual elements that compose an instance.
1. Linear Data Structures: A data structure is said to be linear if the elements form a
sequence. It is sequential and continues in nature i.e. access the data in sequential
manner.
In linear data structure we can not insert an item in middle place and it maintains a linear
relationship between its elements
egs: Array, Linked list, Stack, Queue, Dequeue etc.
2. Non Linear Data Structures: A data structure is said to be non-linear if elements do not
form a sequence. (Not sequential).
It does not maintain any linear relationship between their elements. Every data item is attached to
several other data items in a way that is specific for reflecting relationships. The data items are
not arranged in a sequential structure.
[A data structure is linear if every item is related with next and previous item and it is non
linear if it is attach with many of the items in specific ways to reflect relationship.]
3Q) What is a Singly Linked List?
Ans) Singly Linked List is a Sequence of dynamically allocated Storage elements, each
element of which contains a pointer to its successor. A pointer to the first element of the
list is called as head and a pointer to the last element of the list is called as tail used to
keep track of the list elements.
Ans) In Doubly Linked List each element contains two pointers: One Pointer points to its
successor and another to its predecessor (previous element).It is also called as two way
linked list (traversing can be done in both directions).