GATE Data Structure Quiz

Approved & Edited by ProProfs Editorial Team
The editorial team at ProProfs Quizzes consists of a select group of subject experts, trivia writers, and quiz masters who have authored over 10,000 quizzes taken by more than 100 million users. This team includes our in-house seasoned quiz moderators and subject matter experts. Our editorial experts, spread across the world, are rigorously trained using our comprehensive guidelines to ensure that you receive the highest quality quizzes.
Learn about Our Editorial Process
| By Nauakrimilgai
N
Nauakrimilgai
Community Contributor
Quizzes Created: 12 | Total Attempts: 14,536
Questions: 10 | Attempts: 2,208

SettingsSettingsSettings
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 be 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.


Questions and Answers
  • 1. 

    In linked lists, there are no NULL links in

    • A.

      Single linked list

    • B.

      Linear doubly linked list.

    • C.

      Circular linked list

    • D.

      None of these

    Correct Answer
    C. Circular linked list
    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.

    Rate this question:

  • 2. 

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

    • A.

      2

    • B.

      1

    • C.

      0

    • D.

      3

    Correct Answer
    B. 1
    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.

    Rate this question:

  • 3. 

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

    • A.

      2

    • B.

      5

    • C.

      3

    • D.

      0

    Correct Answer
    C. 3
    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.

    Rate this question:

  • 4. 

    The number of possible ordered trees with 3 nodes A, B, and C is 11.

    • A.

      True

    • B.

      False

    Correct Answer
    B. False
    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.

    Rate this question:

  • 5. 

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

    • A.

      3

    • B.

      Junk value

    • C.

      Run time error

    • D.

      Address of the third element

    Correct Answer
    B. Junk value
    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.

    Rate this question:

  • 6. 

    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

    • A.

      Only (i)

    • B.

      Only (ii)

    • C.

      Both (i) and (ii)

    • D.

      Both (ii) and (III)

    Correct Answer
    C. Both (i) and (ii)
    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.

    Rate this question:

  • 7. 

    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.

    • A.

      True

    • B.

      False

    Correct Answer
    B. False
    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.

    Rate this question:

  • 8. 

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

    • A.

      +, -, *, x, y, z, w

    • B.

      X, -, y, +, z, *, w

    • C.

      X, y, z, w, -, *, +

    • D.

      -, x, y, +, *, z, w

    Correct Answer
    A. +, -, *, x, y, z, w
    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.

    Rate this question:

  • 9. 

    On which principle does stack work?

    • A.

      FILO

    • B.

      FIFO

    • C.

      LIFO

    • D.

      Both a and c above

    Correct Answer
    D. Both a and c above
    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.

    Rate this question:

  • 10. 

    The order of the binary search algorithm is

    • A.

      N

    • B.

      N2

    • C.

      N log n

    • D.

      Log n

    Correct Answer
    C. N log n
    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.

    Rate this question:

Quiz Review Timeline +

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
Advertisement
×

Wait!
Here's an interesting quiz for you.

We have other quizzes matching your interest.