13it33 - Data Structures MCQ Type Test

Reviewed by Editorial Team
The ProProfs editorial team is comprised of experienced subject matter experts. They've collectively created over 10,000 quizzes and lessons, serving over 100 million users. Our team includes in-house content moderators and subject matter experts, as well as a global network of rigorously trained contributors. All adhere to our comprehensive editorial guidelines, ensuring the delivery of high-quality content.
Learn about Our Editorial Process
| By Rmkumar
R
Rmkumar
Community Contributor
Quizzes Created: 2 | Total Attempts: 1,697
| Attempts: 236 | Questions: 30
Please wait...
Question 1 / 30
0 %
0/100
Score 0/100
1. Inserting an item into the stack when stack is not full is called …………. Operation and deletion of item form the stack, when stack is not empty is called ………..operation.

Explanation

When an item is inserted into the stack when it is not full, it is called a "push" operation. This is because the item is being pushed onto the top of the stack. On the other hand, when an item is deleted from the stack when it is not empty, it is called a "pop" operation. This is because the item at the top of the stack is being popped off and removed.

Submit
Please wait...
About This Quiz
13it33 - Data Structures    MCQ Type Test - Quiz

This MCQ test titled '13IT33 - DATA STRUCTURES' evaluates knowledge in binary tree traversals, array operations, and basic data structure concepts. It assesses key skills in searching, traversal,... see moreand understanding of linear and non-linear data structures, essential for learners in computer science. see less

2. Which of the following algorithm design technique is used in the quick sort algorithm?

Explanation

The quicksort algorithm uses the divide and conquer technique. This technique involves breaking down the problem into smaller subproblems, solving them independently, and then combining the solutions to obtain the final result. In the case of quicksort, the algorithm partitions the array into two subarrays based on a pivot element, recursively sorts the subarrays, and then combines them to obtain the sorted array. This divide and conquer approach allows quicksort to efficiently sort large arrays by dividing the sorting process into smaller, manageable parts.

Submit
3. Finding the location of the element with a given value is: 

Explanation

The given question is asking about the process of finding the location of an element with a given value. The correct answer is "Search" because searching refers to the process of looking for a specific element or value in a data structure or array. It involves examining each element until the desired element is found or determining that the element does not exist in the data structure.

Submit
4. Two main measures for the efficiency of an algorithm are 

Explanation

The two main measures for the efficiency of an algorithm are time and space. Time complexity refers to the amount of time taken by an algorithm to run, while space complexity refers to the amount of memory space required by the algorithm to execute. These measures help in evaluating the performance of an algorithm and determining how efficiently it utilizes both time and memory resources.

Submit
5. Term Data Structure refers to _________ and interrelationship between them.  

Explanation

The term "Data Structure" refers to the organization of data elements and their interrelationship. It involves how data is stored, accessed, and manipulated in a computer system. This includes the arrangement of data elements in memory, the relationships between different data elements, and the operations that can be performed on them. Coding standards and programming language statements are not directly related to data structures, although they may be influenced by them. Therefore, the correct answer is "Organization of data element".

Submit
6. The Average case occur in linear search algorithm 

Explanation

The average case for a linear search algorithm occurs when the item being searched for is somewhere in the middle of the array. In this case, the algorithm would need to iterate through approximately half of the array before finding the item. This is because the linear search algorithm checks each element in the array one by one until it finds a match. Therefore, if the item is located in the middle of the array, it would take an average amount of iterations to find it.

Submit
7. The operation of processing each element in the list is known as 

Explanation

Traversal is the correct answer because it refers to the process of accessing and processing each element in a list or data structure. It involves visiting each element one by one, without any specific order or arrangement. Sorting, merging, and inserting are operations that involve rearranging or modifying the elements in a list, while traversal simply involves accessing them.

Submit
8. Which one of the following sequences denotes the post-order traversal for the following tree: 

Explanation

The post-order traversal of a tree visits the left subtree, then the right subtree, and finally the root node. In the given options, the sequence "g c d b f e a" follows this order. It starts with the left subtree, visiting nodes "g c d b", then moves to the right subtree, visiting nodes "f e", and finally visits the root node "a". Therefore, "g c d b f e a" is the correct post-order traversal for the given tree.

Submit
9. The following sequence of operation is performed on stack : push(1),push(2),pop,push(1),push(2),pop,pop,pop,push(2),pop. The sequence of popped out values are ?

Explanation

The given sequence of operations on the stack can be represented as follows:

1. Push 1 onto the stack.
2. Push 2 onto the stack.
3. Pop the top element from the stack, which is 2.
4. Push 1 onto the stack.
5. Push 2 onto the stack.
6. Pop the top element from the stack, which is 2.
7. Pop the top element from the stack, which is 1.
8. Pop the top element from the stack, which is 1.
9. Push 2 onto the stack.
10. Pop the top element from the stack, which is 2.

Therefore, the sequence of popped out values is 2, 2, 1, 1, 2.

Submit
10. Which of the following is useful in traversing a given graph by breadth first search?

Explanation

In breadth-first search, we explore all the vertices of a graph at the same level before moving to the next level. This requires visiting the vertices in the order they were discovered. A queue follows the First-In-First-Out (FIFO) principle, making it suitable for implementing breadth-first search. We can enqueue the starting vertex and then enqueue its adjacent vertices one by one. This ensures that the vertices are visited in the order they were discovered, allowing us to traverse the graph in a breadth-first manner.

Submit
11. What is the result of the following operation Top (Push (S, X))

Explanation

The result of the operation Top (Push (S, X)) is X. This is because the Push operation adds the element X to the top of the stack S, and the Top operation retrieves the element at the top of the stack, which in this case is X.

Submit
12. . ………… is very useful in situation when data have to stored and then retrieved in reverse order.

Explanation

A stack is very useful in situations when data have to be stored and then retrieved in reverse order. In a stack, the last item that is added will be the first one to be removed, making it ideal for reversing the order of data. This is because a stack follows the Last-In-First-Out (LIFO) principle, where the most recently added item is always at the top and is the first one to be accessed. So, when data needs to be retrieved in reverse order, a stack is the appropriate data structure to use.

Submit
13. Which of the following data structure is linear data structure?

Explanation

Arrays are a linear data structure because they store elements in a sequential manner. Each element in an array is accessed by its index position, which starts from 0 and increments by 1. This allows for efficient traversal and retrieval of elements. Arrays have a fixed size and are contiguous in memory, making them suitable for applications that require random access to elements. Trees and graphs, on the other hand, are non-linear data structures as they have hierarchical or interconnected relationships between elements.

Submit
14. The inorder and preorder traversal of a binary tree are d, b, e, a, f, c, g and a, b, d, e, c, f, g  respectively. The postorder traversal of the binary tree is:

Explanation

The postorder traversal of a binary tree follows the pattern of visiting the left subtree, then the right subtree, and finally the root node. By observing the given inorder and preorder traversals, we can determine the root node (a) and the left and right subtrees. The left subtree consists of nodes (d, b, e) and the right subtree consists of nodes (f, c, g). By applying the postorder traversal pattern, we can determine that the postorder traversal of the binary tree is d, e, b, f, g, c, a.

Submit
15. The following numbers are inserted into an empty binary search tree in the given order: 10, 1, 3, 5, 15, 12, 16. What is the height of the binary search tree (the height is the maximum distance of a leaf node from the root)? 

Explanation

The height of a binary search tree is defined as the maximum distance from the root to a leaf node. In this case, the numbers are inserted in the following order: 10, 1, 3, 5, 15, 12, 16. This results in the following binary search tree:

10
/ \
1 15
\ / \
3 12 16
\
5

The longest path from the root to a leaf node is 10 -> 15 -> 16, which has a distance of 3. Therefore, the height of the binary search tree is 3.

Submit
16. Which one of the following array represents a binary max-heap?

Explanation

not-available-via-ai

Submit
17.  ……………. Is a pile in which items are added at one end and removed from the other. 

Explanation

A queue is a data structure in which items are added at one end (rear) and removed from the other end (front). This follows the principle of First-In-First-Out (FIFO), where the item that is added first will be the first one to be removed. In a queue, new items are always added to the rear end, while removal happens from the front end. Therefore, the correct answer is Queue.

Submit
18. The postfix expression for * + a b - c d is?

Explanation

The given postfix expression is obtained by converting the given infix expression to postfix notation. In postfix notation, the operators are placed after their operands. The expression "ab + cd - *" can be evaluated as follows: first, the operands "a" and "b" are added, then the operands "c" and "d" are subtracted, and finally, the result of the addition and subtraction are multiplied. Therefore, the correct postfix expression for * + a b - c d is "ab + cd - *".

Submit
19. Which of the following data structure is not linear data structure? 

Explanation

The correct answer is "None of above". This means that both arrays and linked lists are linear data structures. Arrays store elements in contiguous memory locations, allowing for random access to elements. Linked lists, on the other hand, store elements in separate nodes that are connected through pointers. Both arrays and linked lists have a linear arrangement of elements, making them linear data structures. Therefore, the correct answer is "None of above" as there is no data structure mentioned in the options that is not a linear data structure.

Submit
20. Linked list are not suitable data structure of which one of the following problems ?

Explanation

Linked lists are not suitable for binary search because binary search requires random access to elements, which is not efficiently supported by linked lists. In binary search, we need to access the middle element of the sorted list repeatedly, and this operation takes O(n) time in a linked list as we have to traverse the list from the beginning each time. On the other hand, arrays or other data structures that support random access are more suitable for binary search as they allow direct access to any element in O(1) time.

Submit
21. The complexity of linear search algorithm is 

Explanation

The complexity of a linear search algorithm is O(n) because it iterates through each element in the input list or array until it finds the desired element or reaches the end. As the size of the input increases, the time taken to search also increases linearly. Therefore, the time complexity is directly proportional to the size of the input, resulting in O(n) complexity.

Submit
22. The time factor when determining the efficiency of algorithm is measured by

Explanation

The efficiency of an algorithm is determined by measuring the time factor, which is done by counting the number of key operations. Key operations refer to the fundamental operations or steps that the algorithm performs, such as comparisons, assignments, and arithmetic operations. By counting the number of key operations, we can get an idea of how efficient the algorithm is in terms of time complexity. This allows us to compare and analyze different algorithms to choose the most efficient one for a given problem.

Submit
23. Arrays are best data structures 

Explanation

Arrays are best data structures for relatively permanent collections of data because arrays provide efficient access to elements based on their index. Once the elements are stored in an array, they can be accessed directly using their index position, making it suitable for collections that do not frequently change in size or content. Arrays also have a fixed size, which makes them ideal for storing a fixed number of elements. However, if the size of the structure and the data in the structure are constantly changing, other data structures like linked lists or dynamic arrays may be more appropriate.

Submit
24. Consider the following graphWhich one of the following is NOT the sequences of edges added to the minimum spanning tree using Kruskal algorithm?

Explanation

not-available-via-ai

Submit
25. Linked lists are best suited 

Explanation

Linked lists are best suited for the size of the structure and the data in the structure are constantly changing because linked lists allow for efficient insertion and deletion of elements at any position in the list. This is because each element in a linked list contains a reference to the next element, allowing for easy rearrangement of the list. Moreover, linked lists do not require contiguous memory allocation, making them flexible for dynamically changing data sizes. Therefore, linked lists are an ideal choice when the size of the structure and the data within it are frequently modified.

Submit
26. The complexity of merge sort algorithm is

Explanation

The complexity of merge sort algorithm is O(n log n) because it divides the input array into two halves, recursively sorts them, and then merges the sorted halves. The divide and conquer approach ensures that the algorithm has a time complexity of O(n log n), where n is the number of elements in the array. This is because the array is continuously divided into halves until individual elements are obtained, and then the merge operation combines the sorted halves in a linear time complexity. Therefore, the overall time complexity of merge sort is O(n log n).

Submit
27. The Worst case occur in linear search algorithm when 

Explanation

In the worst case scenario for a linear search algorithm, the item being searched for is either the last element in the array or it is not present in the array at all. This is because in a linear search, each element of the array is checked one by one until the desired item is found or the end of the array is reached. If the item is the last element, it will take the maximum number of comparisons to find it. Similarly, if the item is not present in the array, the search will have to go through all the elements before determining its absence.

Submit
28. Which of the following is useful in implementing quick sort?

Explanation

Stack is useful in implementing quick sort because quick sort uses a divide and conquer approach, where it repeatedly divides the array into smaller subarrays. The stack data structure helps in keeping track of the subarrays that need to be sorted, allowing for efficient recursion and backtracking. As the algorithm progresses, the stack stores the indices of the subarrays that still need to be partitioned, ensuring that the sorting process is done correctly.

Submit
29. A binary search tree contains the values 1, 2, 3, 4, 5, 6, 7, 8. The tree is traversed in pre-order and the values are printed out. Which of the following sequences is valid output?

Explanation

In a binary search tree, the pre-order traversal visits the root node first, then the left subtree, and finally the right subtree. Looking at the given sequences, we can see that the sequence "5 3 1 2 4 7 6 8" is a valid output because it follows the pre-order traversal pattern. The root node is 5, the left subtree contains the nodes 3, 1, and 2, and the right subtree contains the nodes 4, 7, 6, and 8. Therefore, the given sequence is a valid pre-order traversal of the binary search tree.

Submit
30. The complexity of Bubble sort algorithm is 

Explanation

Bubble sort is a simple sorting algorithm that repeatedly steps through the list, compares adjacent elements, and swaps them if they are in the wrong order. The time complexity of bubble sort is O(n^2) because in the worst case scenario, where the list is in reverse order, it requires n-1 passes to sort n elements. In each pass, bubble sort compares and swaps adjacent elements, resulting in a total of (n-1) + (n-2) + ... + 1 comparisons, which is approximately n^2/2. Therefore, the time complexity of bubble sort is O(n^2).

Submit
View My Results

Quiz Review Timeline (Updated): Mar 20, 2023 +

Our quizzes are rigorously reviewed, monitored and continuously updated by our expert board to maintain accuracy, relevance, and timeliness.

  • Current Version
  • Mar 20, 2023
    Quiz Edited by
    ProProfs Editorial Team
  • Oct 16, 2015
    Quiz Created by
    Rmkumar
Cancel
  • All
    All (30)
  • Unanswered
    Unanswered ()
  • Answered
    Answered ()
Inserting an item into the stack when stack is not full is called...
Which of the following algorithm design technique is used in the quick...
Finding the location of the element with a given value is: 
Two main measures for the efficiency of an algorithm are 
Term Data Structure refers to _________ and interrelationship between...
The Average case occur in linear search algorithm 
The operation of processing each element in the list is known as 
Which one of the following sequences denotes the post-order traversal...
The following sequence of operation is performed on stack :...
Which of the following is useful in traversing a given graph by...
What is the result of the following operation Top (Push (S, X))
. ………… is very useful in situation when...
Which of the following data structure is linear data structure?
The inorder and preorder traversal of a binary tree are d, b, e, a, f,...
The following numbers are inserted into an empty binary search tree in...
Which one of the following array represents a binary max-heap?
 ……………. Is a pile in which...
The postfix expression for * + a b - c d is?
Which of the following data structure is not linear data...
Linked list are not suitable data structure of which one of the...
The complexity of linear search algorithm is 
The time factor when determining the efficiency of algorithm is...
Arrays are best data structures 
Consider the following graphWhich one of the following is NOT the...
Linked lists are best suited 
The complexity of merge sort algorithm is
The Worst case occur in linear search algorithm when 
Which of the following is useful in implementing quick sort?
A binary search tree contains the values 1, 2, 3, 4, 5, 6, 7, 8. The...
The complexity of Bubble sort algorithm is 
Alert!

Advertisement