0% found this document useful (0 votes)
99 views5 pages

Tentative Questions For The Data Structures Viva

This document contains 23 tentative questions for a data structures viva. It covers topics like definitions of data structures, areas where they are applied, common data structures like arrays, stacks, queues, linked lists, trees and graphs. It also includes questions comparing and contrasting different data structures like arrays vs linked lists, stacks vs queues. Other questions cover concepts like recursion, searching, sorting algorithms, dynamic memory allocation and linked list types.

Uploaded by

Fake Account
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
99 views5 pages

Tentative Questions For The Data Structures Viva

This document contains 23 tentative questions for a data structures viva. It covers topics like definitions of data structures, areas where they are applied, common data structures like arrays, stacks, queues, linked lists, trees and graphs. It also includes questions comparing and contrasting different data structures like arrays vs linked lists, stacks vs queues. Other questions cover concepts like recursion, searching, sorting algorithms, dynamic memory allocation and linked list types.

Uploaded by

Fake Account
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 5

TENTATIVE QUESTIONS FOR THE DATA

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.

3. What are the different Data Structures?


1. Arrays
2. Stacks
3. Queues
4. Linked list
5. Trees
6. Graphs

4. What is the difference between Array and Linked list?

1. Access: Random / Sequential

 Stack elements can be randomly Accessed using Subscript Variable


 e.g a[0],a[1],a[3] can be randomly accessed
 While In Linked List we have to Traverse Through the Linked List for Accessing Element.
So O(n) Time required for Accessing Element .
 Generally In linked List Elements are accessed sequentially.

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.

6. What is the data structures used to perform recursion?


Stack. Because of its LIFO (Last In First Out) property it remembers its 'caller' so knows whom to
return when the function has to return. Recursion makes use of system stack for storing the return
addresses of the function calls.

7. What is the difference between a PUSH and a POP?


Pushing and popping applies to the way data is stored and retrieved in a stack. A push denotes data
being added to it, meaning data is being “pushed” into the stack. On the other hand, a pop denotes
data retrieval, and in particular refers to the topmost data being accessed.

8. What is a linear search?


A linear search refers to the way a target key is being searched in a sequential data structure. Using
this method, each element in the list is checked and compared against the target key, and is repeated
until found or if the end of the list has been reached.

9. Which sorting algorithm is considered the fastest?


There are many types of sorting algorithms: quick sort, bubble sort, balloon sort, radix sort, merges
sort, etc. Not one can be considered the fastest because each algorithm is designed for a particular data
structure and data set. It would depend on the data set that you would want to sort.

10. Differentiate STACK from ARRAY.


Data that is stored in a stack follows a LIFO pattern. This means that data access follows a sequence
wherein the last data to be stored will the first one to be extracted. Arrays, on the other hand, does not
follow a particular order and instead can be accessed by referring to the indexed element within the
array.

11.  What is a dequeue?


A dequeue is a double-ended queue. This is a structure wherein elements can be inserted or removed
from either end.

12. Differentiate linear from non-linear data structure.


Linear data structure is a structure wherein data elements are adjacent to each other. Examples of
linear data structure include arrays, linked lists, stacks and queues. On the other hand, non-linear data
structure is a structure wherein each data element can connect to more than two adjacent data
elements. Examples of non-linear data structure include trees and graphs.
13. Difference between Stack and Queue.
Stack is an ordered list in which insertion and deletion of list items can be done only in one end called
the top. Due to this reason, stack is considered as a Last in First out (LIFO) data structure. Queue is
also an ordered list in which insertion of list items are done in one end called the rear, and the deletion
of items are done in the other end called the front. This insertion and deletion mechanism makes the
queue a First in First out (FIFO) data structure.

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.

16. Difference between Normal and Circular Queue.


Simple queue is a linear queue having front & rear to insert & delete elements from the list. But
there is a boundary that we have to insert at rear & have to delete from front. For this reason
instead of having space in the queue if there is a single element in the rear, the queue is full. The
other space is wasted. To utilize space properly, circular queue is derived. In this queue the
elements are inserted in circular manner. So that no space is wasted at all.
Circular Queue is better than a normal queue because in this we can effectively utilise the
memory space. If we have a normal queue and have deleted some elements from there then
empty space is created there and even if the queue has empty cells then also we cannot insert any
new element because the insertion has to be done from one side only (i.e rear or tail) and
deletion has to be done from another side (i.e front or head).

17. What are the methods of traversing a tree?


Tree traversal means to display or access each and every node of a tree. There are 3 methods of
tree traversal:-
1. INORDER TRAVERSAL (LEFT, ROOT, RIGHT)
2. PREORDER TRAVERSAL (ROOT, LEFT, RIGHT)
3. POSTORDER TRAVERSAL (LEFT, RIGHT, ROOT)

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.

20. Whether linked list is linear or Non Linear?


According to Access strategies Linked list is a linear one. According to Storage Linked List
is a Non-linear one.

21. Define an algorithm. What are the properties of an algorithm?


Algorithm: A step by step process to get the solution for a well-defined problem.

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

22. Explain the types of linked lists.


The types of linked lists are:

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.

23. What is dynamic memory allocation?


Dynamic memory allocations means to allocate memory at the runtime.
There are 3 dynamic memory allocation functions:-
1) Malloc (Allocating uninitialized memory)
This function allocates the memory and returns the pointer to the allocated memory.

2) Calloc (Memory allocation + Initialization)


Calloc also allocates memory on heap like malloc does. The only difference is that calloc also
initialize the memory with zero (malloc returns uninitialized memory).

3) Realloc (changes the size of the memory block)


GO THROUGH THE FOLLOWING QUESTIONZ ONCE
1. Applications of Stacks.
2. Conversion from Infix to prefix and postfix
3. Evaluation of Postfix
4. Recursion
5. Underflow and overflow condition for stack.
6. Underflow and overflow condition for Normal and Circular Queue.
7. What do you mean by “Top” of the Stack?
8. What is Rear and Front of the Queue?
9. Doubly linked list.
10. How is Stack represented as an array?
11. How is Stack represented as a Linked list?
12. Representation of Normal and Circular Queues as Linked list.
13. Representation of Normal Queues and Circular Queue as an array.
14. Push and Pop operations in Stack.
15. Trees – all the basic terminology of trees.
16. Diff between binary tree and complete binary tree.
17. Binary search tree – creation, insertion, deletion, searching in BST.
18. Preorder, Postorder and Inorder Traversal of the Binary tree.
19. AVL Tree
20. M-way Search Tree and B Tree
21. Multilevel indexing
22. Searching and Sorting with Complexities.

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

ALL THE BEST 

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy