# Data Structure MCQ Computer Science

50 Questions 30 Mins

### About Data Structure

Following are some of the multiple choice questions on the Data Structure with answers that will help the students in developing their knowledge.

## Data Structure MCQ

### 1. What is a data structure?

• A method of arranging data
• A way of keeping data without an order?
• A "stack" only
• There is no formal definition for "Data Structure"

### 2. Which of the following data structure is linear type?

• Stack
• Array
• Queue
• All of the above

### 4. Which data structure is needed to convert infix notation to postfix notation

• Stack
• Array
• Queue
• None of these

### 5. Which of the following is the most widely used external memory data structure?

• AVL tree
• B-tree
• Red-black tree
• Both AVL tree and Red-black tree

### 6. A variant of linked list in which last node of the list points to the first node of the list is?

• Singly linked list
• Doubly linked list
• Circular linked list
• none of the above

### 7. In simple chaining, what data structure is appropriate

• Circular linked list
• Singly linked list
• Doubly linked list
• Binary trees

• Array
• Binary Tree
• Queue
• Stacks

• Array
• Binary tree
• Stack

• Heap
• Tree
• List
• Array

• Array
• Tree
• Queue
• Stack

• Array
• Stack
• Queue
• Binary Tree

### 13. Which of the following applications may use a stack?

• A parentheses balancing program
• Tracking of local variables at run time
• Compiler Syntax Analyzer
• Data Transfer between two asynchronous process

### 14. Which data structure can be used to test a palindrome

• Tree
• Heap
• Stack
• Priority queue

### 15. Which data structure is used by map

• Array
• DS Tutorial
• Both A & B
• none of the above

• Op 1: 15
• Op 2: 25
• Op 3: 63
• Op 4: 31

### 17. Which data structure is needed to convert infix to postfix

• Branch data structure
• Tree data structure
• Stack data structure
• Queue data structure

• Array
• Stack
• Queue

### 19. A struct is typically a ____ data structure.

• simple
• heterogeneous
• dynamic

### 20. Which data structure conveniently used to implement dfs

• Stacks
• Queues
• Priority Queues
• Both A & B

• Tree
• Array
• Queue
• Stack

• Root
• Branch
• Child
• Leaf

### 23. Which one of the following is not the application of the stack data structure

• String reversal
• Recursion
• Backtracking
• Asynchronous data transfer

• quick
• heap
• shell
• selection

### 26. Suppose we are sorting an array of eight integers using quick sort, and we have just finished the first partitioning with the array looking like this:2 5 1 7 9 12 11 10Identify the correct statement?

• Neither the 7 nor the 9 is the pivot.
• The pivot could be either the 7 or the 9.
• The pivot is not the 7, but it could be the 9.
• The pivot could be the 7, but it is not the 9.

• FIFO
• LIFO
• Linear
• Ordered

### 28. Entries in a stack are “ordered”. What is the meaning of this statement?

• A collection of stacks is sortable
• Stack entries may be compared with the ‘<‘ operation
• The entries are stored in a linked list
• There is a Sequential entry that is one by one

• 1
• 2
• 3
• 4

• Array
• graph
• Directory

### 31. Which of the following tree data structures is not a balanced binary tree?

• AVL tree
• Red-black tree
• Splay tree
• B-tree

### 32. Which of the following data structure is not a linear data structure

• Arrays
• Both A & B
• None of these

• Overflow
• Empty
• Underflow
• Full

### 34. Choose the correct statement

• A data structure is a specialised format for organising and storing data
• A data structure is a specialised format for organising and storing information
• A data structure is a format for organising and storing only one data type
• A data structure is too complicated to truly understand or use

### 35. Storage for data defined in terms of set of operations to be performed on the data

• Arrays
• Variables
• Abstract Data Types
• Algorithms

• 1
• 14
• 74
• -18

• True
• False

• Stack
• Queue
• Tree
• Liked list

• Op 1: Tree
• Op 2: Stack
• Op 3: Graph
• Op 4: Queue

### 40. Stack is also called as

• Last in first out
• First in last out
• Last in last out
• First in first out

### 41. A FIFO structure implemented as a ring where the front and rear pointers can wrap around the end of the start of the array.

• Linear Queue
• Circular Queue
• Priority Queue
• none of the above

### 42. Which of the following is not a technique to avoid a collision?

• Make the hash function appear random
• Use the chaining method
• Use uniform hashing
• Increasing hash table size

### 43. Which of the following points is/are true about Linked List data structure when it is compared with array

• It is easy to insert and delete elements in Linked List
• Random access is not allowed in a typical implementation of Linked Lists
• The size of array has to be pre-decided, linked lists can change their size any time.
• All of the above

### 44. To measure Time complexity of an algorithm Big O notation is used which:

• describes limiting behaviour of the function
• characterises a function based on growth of function
• upper bound on growth rate of the function
• all of the mentioned

### 45. Which among the below specified condition is applicable if the Queue is non - empty?

• rear > front
• rear < front
• rear = front
• Unpredictable

### 46. What does the following function do for a given Linked List with first node as head?

```void fun1(struct node * head) {
if (head == NULL) return;
}```
• Prints all nodes of linked lists
• Prints all nodes of linked list in reverse order
• Prints alternate nodes of Linked List
• Prints alternate nodes in reverse order

### 47. Which ospf data structure is identical on all ospf routers that share the same area?

• forwarding database
• routing table

• linear
• non linear
• both a and b
• all of above

### 49. Every stack has a variable _________ associated with it.

• TOP
• BOT
• POT
• none of the above

### 50. It is a step by step process to solve a given problem. Take the simplest example below.

• Pseudo code
• Programming
• Algorithm
• none of the above