GATE Data Structure Quiz

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 Nauakrimilgai
N
Nauakrimilgai
Community Contributor
Quizzes Created: 12 | Total Attempts: 15,439
| Attempts: 2,309 | Questions: 10
Please wait...
Question 1 / 10
0 %
0/100
Score 0/100
1. The number of possible ordered trees with 3 nodes A, B, and C is 11.

Explanation

The number of possible ordered trees with 3 nodes A, B, and C is not 11. In fact, the number of possible ordered trees with 3 nodes is only 5. This can be determined by listing out all the possible arrangements of the nodes and counting them. Therefore, the given statement is false.

Submit
Please wait...
About This Quiz
GATE Data Structure Quiz - Quiz

So, here is a challenge for you. Can you pass this Gate data structure quiz with a score equal to or above 70? If yes, then you will... see morebe called an expert. In the field of computer science, a data structure is meant by a data organization, management, and storage format usually chosen for the purpose of efficient access to data. These are some questions that are not only for your practice but also to give you a better understanding of the data structure. All the best.
see less

2. In linked lists, there are no NULL links in

Explanation

Circular linked lists do not have NULL links because the last node in the list points back to the first node, creating a circular structure. This means that there is no end of the list and traversal can continue indefinitely. Unlike single linked lists and linear doubly linked lists, where the last node points to NULL, circular linked lists provide a way to iterate through the list in a continuous loop.

Submit
3. A queue has configuration a,b,c,d. If you want to get the configuration d,c,b,a, you need a minimum of 2 deletions and 3 additions.

Explanation

To get the configuration d,c,b,a from the configuration a,b,c,d, we need to reverse the order of the elements. However, in a queue, we can only remove elements from the front and add elements to the back. Therefore, we would need to remove all elements from the queue and add them back in reverse order. This would require a minimum of 4 deletions and 4 additions, not 2 deletions and 3 additions. Therefore, the statement is false.

Submit
4. In a balanced binary tree, the height of two sub-trees of every node can not differ by more than

Explanation

In a balanced binary tree, the height of two sub-trees of every node cannot differ by more than 1. This means that the heights of the left and right sub-trees of any given node should have a difference of at most 1. This property ensures that the tree is balanced and allows for efficient searching, insertion, and deletion operations. If the height difference exceeds 1, the tree is considered unbalanced, which can lead to slower performance and inefficient operations. Therefore, the correct answer is 1.

Submit
5. If the out-degree of every node is exactly equal to M or 0 and the number of nodes at level K is Mk-1 [con sider root at level 1], then the tree is called as  (i) Full m-ary try(ii) Com plete m-ary tree(iii)Positional m-ary tree

Explanation

A tree where every node has either M children or no children at all is called a full m-ary tree. Additionally, if the number of nodes at level K is Mk-1, then the tree is also a complete m-ary tree. Therefore, the correct answer is Both (i) and (ii) because the given conditions satisfy both the definitions of a full m-ary tree and a complete m-ary tree.

Submit
6. In the following tree: If post-order traversal generates sequence XY-zw*+, then label of nodes 1234567 will be

Explanation

The given post-order traversal sequence is XY-zw*+. In a post-order traversal, the left subtree is visited first, then the right subtree, and finally the root node. Therefore, the label of the root node is the last element in the post-order traversal sequence, which is +. The label of the left subtree's root node is the element before the root node in the post-order traversal sequence, which is -. The label of the right subtree's root node is the element before the left subtree's root node, which is *. The labels of the remaining nodes can be determined in a similar manner, resulting in the sequence +, -, *, x, y, z, w.

Submit
7. Write the output of the following program:
int a[ ] = {1,2,3,} *p;

Explanation

The given program declares an integer array 'a' with 3 elements and initializes them with the values 1, 2, and 3. It then declares a pointer variable 'p'. However, the program does not assign any address to the pointer 'p'. Therefore, when the program tries to access the value pointed by 'p', it will result in a junk value because 'p' does not point to a valid memory location.

Submit
8. The order of the binary search algorithm is

Explanation

The order of the binary search algorithm is n log n. This means that the time complexity of the algorithm is proportional to the logarithm of the input size multiplied by the input size itself. In other words, as the size of the input increases, the time taken to perform the binary search also increases, but at a slower rate compared to a linear search algorithm. This is because binary search divides the search space in half with each iteration, making it more efficient than linear search.

Submit
9. In the array representation of the binary tree, the right child of the root will be at the location of

Explanation

In the array representation of a binary tree, the right child of the root will be at the location of 3. This is because in a binary tree, the left child is typically represented at index 2*i+1 and the right child is represented at index 2*i+2, where i is the index of the parent node. In this case, the root is at index 0, so the right child will be at index 2*0+2 = 2. Therefore, the right child of the root will be at the location of 3 in the array.

Submit
10. On which principle does stack work?

Explanation

The stack works on the principle of FILO or LIFO, which stands for "First In, Last Out" and "Last In, First Out" respectively. LIFO means, in a stack, the last element added is the first one to be removed. FILO means that the first item inserted into the stack will be the last one to be removed. In other words, the most recently added item is the first one to be removed from the stack. This principle is commonly used in computer science and data structures, where a stack is a collection of elements with a specific order of operations.

Submit
View My Results

Quiz Review Timeline (Updated): Aug 23, 2023 +

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

  • Current Version
  • Aug 23, 2023
    Quiz Edited by
    ProProfs Editorial Team
  • Jul 07, 2012
    Quiz Created by
    Nauakrimilgai
Cancel
  • All
    All (10)
  • Unanswered
    Unanswered ()
  • Answered
    Answered ()
The number of possible ordered trees with 3 nodes A, B, and C is 11.
In linked lists, there are no NULL links in
A queue has configuration a,b,c,d. If you want to get the...
In a balanced binary tree, the height of two sub-trees of every node...
If the out-degree of every node is exactly equal to M or 0 and the...
In the following tree: If post-order traversal generates sequence...
Write the output of the following program:int a[ ] = {1,2,3,} *p;
The order of the binary search algorithm is
In the array representation of the binary tree, the right child of the...
On which principle does stack work?
Alert!

Advertisement