Data Structure Basic Questions Quiz! Test

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 Ashishdoorwar96
A
Ashishdoorwar96
Community Contributor
Quizzes Created: 2 | Total Attempts: 913
Questions: 10 | Attempts: 607

SettingsSettingsSettings
Data Structure Basic Questions Quiz! Test - Quiz


What do you know about data structure? Do you suppose you can make the grade on this quiz? Anything that can store data can be referred to as a data structure. Data structures are programmed to store ordered information so that various operations can be performed quickly. It represents the knowledge of data to be organized in memory. Take this quiz and see how much you know about data structure.


Questions and Answers
  • 1. 

    A linear collection of data elements where the linear node is given by means of the pointer is

    • A.

      Linked list

    • B.

      Node list

    • C.

      Primitive list

    • D.

      None of these

    Correct Answer
    A. Linked list
    Explanation
    A linked list is a linear collection of data elements where each element, called a node, contains a value and a pointer that points to the next node in the list. This allows for efficient insertion and deletion operations at any position in the list. The other options, node list and primitive list, do not accurately describe this type of data structure. Therefore, the correct answer is linked list.

    Rate this question:

  • 2. 

    Representation of data structure in memory is known as:

    • A.

      Recursive

    • B.

      Abstract data type

    • C.

      Storage structure

    • D.

      file structure

    Correct Answer
    B. Abstract data type
    Explanation
    The representation of a data structure in memory is known as an abstract data type. An abstract data type defines the behavior and properties of a data structure without specifying its implementation details. It provides a high-level view of the data structure, allowing users to interact with it through a set of predefined operations, while hiding the underlying implementation. This abstraction promotes code reusability, modularity, and encapsulation, making it easier to manage and manipulate complex data structures.

    Rate this question:

  • 3. 

    An adjacency matrix representation of a graph cannot contain information of :

    • A.

      Nodes

    • B.

      Edges

    • C.

      Direction of edges

    • D.

      Parallel edges

    Correct Answer
    D. Parallel edges
    Explanation
    An adjacency matrix representation of a graph cannot contain information about parallel edges. This is because an adjacency matrix is a two-dimensional array where each element represents the connection between two nodes. In this representation, a value of 1 indicates the presence of an edge between two nodes, while a value of 0 indicates the absence of an edge. However, since parallel edges refer to multiple edges between the same pair of nodes, it is not possible to represent this information in an adjacency matrix as it can only store binary values for edge presence or absence.

    Rate this question:

  • 4. 

    Quicksort is also known as

    • A.

      Merge sort

    • B.

      Heap sort

    • C.

      Bubble sort

    • D.

      None of these

    Correct Answer
    D. None of these
    Explanation
    Quicksort is not known as merge sort, heap sort, or bubble sort. It is a sorting algorithm in its own right and is distinct from these other sorting algorithms.

    Rate this question:

  • 5. 

    Which of the following data structure is linear data structure?

    • A.

      Trees

    • B.

      Graphs

    • C.

      Arrays

    • D.

      None of above

    Correct Answer
    C. Arrays
    Explanation
    Arrays are a linear data structure because they store elements in a contiguous memory location. Each element in an array can be accessed using its index, which represents its position in the array. This allows for efficient random access to elements. Additionally, arrays have a fixed size, and elements can be easily inserted or deleted at the beginning or end of the array. Thus, arrays follow a linear order and are considered a linear data structure.

    Rate this question:

  • 6. 

    The best average behaviour is shown by

    • A.

      Quick Sort

    • B.

      Merge Sort

    • C.

      Insertion Sort

    • D.

      Heap Sort

    Correct Answer
    A. Quick Sort
    Explanation
    Quick Sort has the best average behavior among the given sorting algorithms. It is a divide-and-conquer algorithm that works by selecting a pivot element and partitioning the array around it. This process is repeated recursively on the sub-arrays until the entire array is sorted. Quick Sort has an average time complexity of O(n log n), which makes it efficient for large datasets. It also has good cache performance and can be implemented in-place, requiring little additional memory. Overall, Quick Sort is known for its fast average case performance, making it the best choice among the given options.

    Rate this question:

  • 7. 

    A queue is a,

    • A.

      FIFO (First In First Out) list.

    • B.

      LIFO (Last In First Out) list.

    • C.

      Ordered array.

    • D.

      Linear tree.

    Correct Answer
    A. FIFO (First In First Out) list.
    Explanation
    A queue follows the FIFO (First In First Out) principle, meaning that the first element inserted into the queue is the first one to be removed. This is similar to a line of people waiting for a service, where the person who arrives first is the first to be served. Therefore, the correct answer is FIFO (First In First Out) list.

    Rate this question:

  • 8. 

    Which data structure is needed to convert infix notation to postfix notation?

    • A.

      Branch

    • B.

      Queue

    • C.

      Tree

    • D.

      Stack

    Correct Answer
    D. Stack
    Explanation
    A stack is needed to convert infix notation to postfix notation. In infix notation, operators are written between operands, while in postfix notation, operators are written after the operands. To convert infix to postfix, we scan the infix expression from left to right and push operands onto the stack. When an operator is encountered, we compare its precedence with the top of the stack. If the operator has higher precedence, we push it onto the stack. If the operator has lower or equal precedence, we pop operators from the stack and append them to the postfix expression until we find an operator with lower precedence or an opening parenthesis.

    Rate this question:

  • 9. 

    The postfix form of the expression (A+ B)*(C*D− E)*F / G is

    • A.

      AB+ CD*E − FG /**

    • B.

      AB + CD* E − F **G /

    • C.

      AB + CD* E − *F *G /

    • D.

      AB + CDE * − * F *G /

    Correct Answer
    A. AB+ CD*E − FG /**
    Explanation
    The given expression is in infix form. To convert it to postfix form, we use the following rules:
    1. Start scanning the expression from left to right.
    2. If an operand is encountered, add it to the postfix expression.
    3. If an operator is encountered, check the precedence of the operator with the top of the stack.
    a. If the precedence of the operator is higher than the top of the stack, push it onto the stack.
    b. If the precedence of the operator is lower than or equal to the top of the stack, pop the operators from the stack until a lower precedence operator is encountered or the stack is empty. Then push the current operator onto the stack.
    4. If a left parenthesis is encountered, push it onto the stack.
    5. If a right parenthesis is encountered, pop the operators from the stack until a left parenthesis is encountered. Pop and add the left parenthesis to the postfix expression.
    6. Repeat steps 2-5 until the expression is scanned completely.
    7. Pop the remaining operators from the stack and add them to the postfix expression.

    Applying these rules, the postfix form of the given expression is AB+ CD*E − FG /**.

    Rate this question:

  • 10. 

    A full binary tree with n leaves contains

    • A.

      N nodes.

    • B.

      Log n 2 nodes.

    • C.

      2n –1 nodes.

    • D.

      n 2 nodes.

    Correct Answer
    C. 2n –1 nodes.
    Explanation
    A full binary tree is a binary tree in which each node has either 0 or 2 children. In such a tree, the number of nodes can be calculated using the formula 2n - 1, where n is the number of leaves. This formula holds true because each internal node (node with 2 children) contributes to the total count of nodes, and there are exactly n - 1 internal nodes in a full binary tree with n leaves. Therefore, the correct answer is 2n - 1 nodes.

    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
  • Mar 22, 2023
    Quiz Edited by
    ProProfs Editorial Team
  • Nov 26, 2012
    Quiz Created by
    Ashishdoorwar96
Advertisement
×

Wait!
Here's an interesting quiz for you.

We have other quizzes matching your interest.