Tentative Questions For The Data Structures Viva
Tentative Questions For The Data Structures Viva
STRUCTURES VIVA
1. What is data structure?
A data structure is a way of organizing data that considers not only the items stored, but also
their relationship to each other. Advance knowledge about the relationship between data items
allows designing of efficient algorithms for the manipulation of data.
2. List out the areas in which data structures are applied extensively?
Compiler Design, Operating System, Database Management System, Statistical analysis
package, Numerical Analysis, Graphics, Artificial Intelligence, Simulation.
2. Memory Structure:
Stack is stored in contiguous Memory Locations, i.e suppose first element is Stored at 2000 then
Second Integer element will be stored at 2002.
But It is not necessary to store next element at the Consecutive memory Location.
Element is stored at any available Location, but the Pointer to that memory location is stored in
Previous Node.
3. Insertion / Deletion
As the Array elements are stored in Consecutive memory Locations, so While Inserting
elements, we have to create space for Insertion.
So More time required for Creating space and Inserting Element
Similarly We have to Delete the Element from given Location and then Shift All successive
elements up by 1 position
In Linked List we have to Just Change the Pointer address field (Pointer),So Insertion and
Deletion Operations are quite easy to implement
4. Memory Allocation:
Memory should be allocated at Compile-Time in Stack. i.e at the time when Programmer is
Writing Program
In Linked list memory can be allocated at Run-Time , i.e After executing Program
Stack uses Static Memory Allocation and Linked List Uses Dynamic Memory Allocation
Dynamic Memory allocation functions – malloc, calloc, delete etc…
5. WHAT is the Minimum number of queues needed to implement the priority queue?
Two Queues are used to implement priority queue. One queue is used for actual storing of data and
another for storing priorities.
14. UNDERFLOW CONDITION – When you try to delete an element from an empty data
structure.
15. OVERFLOW CONDITION – When you try to insert an element to a data structure i.e
completely full.
18. What is the difference between Binary Search and Linear Search?
1) Linear search, also known as the sequential search is the simplest search algorithm. It
searches for a specified value in a list by checking every element in the list. Binary search is
also a method used to locate a specified value in a sorted list. Binary search method halves the
number of elements checked (in each iteration), reducing the time taken to locate the given
item in the list.
2) While binary search operates on sorted lists, liner search can operate on unsorted lists as well.
Sorting a list generally has an average case complexity of n log n.
3) Linear search is simple and straightforward to implement than the binary search.
4) Linear search is too slow to be used with large lists due to its o(n) average case performance.
On the other hand, binary search is considered to be a more efficient method that could be
used with large lists. But implementing the binary search could be quite tricky.
19. What are the disadvantages of representing a stack or queue by a linked list?
i) A node in a linked list (info and next field) occupies more storage than a corresponding element in
an array.
ii) Additional time spent in managing the available list.
Properties of an algorithm:
-Should be written in simple English
- Should be unambiguous, precise and lucid
- Should provide the correct solutions
- Should have an end point
- The output statements should follow input, process instructions
- The initial statements should be of input statements
- Should have finite number of steps
- Every statement should be definitive
1) Singly linked list: It has only head part and corresponding references to the next nodes.
2) Doubly linked list: A linked list which both head and tail parts, thus allowing the traversal in
bi-directional fashion. Except the first node, the head node refers to the previous node.
3) Circular linked list: A linked list whose last node has reference to the first node.
IMPORTANT
1. Just go through your files once and see all the programs done in the
file.
2. Get your files spiralled properly.
3. Be in proper formals.
4. First shift – 12 noon
5. Second shift – 9 am sharp