Data Structure & Algorithyms

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 Imac2013
I
Imac2013
Community Contributor
Quizzes Created: 3 | Total Attempts: 2,519
Questions: 15 | Attempts: 272

SettingsSettingsSettings
Data Structure Quizzes & Trivia

Lets Check Yourself. . . . . .


Questions and Answers
  • 1. 

    The situation when in a linked list START=NULL is

    • A.

      Underflow

    • B.

      Overflow

    • C.

      Housefull

    • D.

      saturated

    Correct Answer
    A. Underflow
    Explanation
    When the linked list's START pointer is NULL, it indicates that the list is empty and there are no elements in it. This situation is known as underflow. Underflow occurs when we try to retrieve or access elements from an empty data structure, which is not possible. Therefore, the correct answer is underflow.

    Rate this question:

  • 2. 

    On which prinicple does stack work?

    • A.

      FILO

    • B.

      FIFO

    • C.

      LILO

    • D.

      Both a and c above

    Correct Answer
    B. FIFO
    Explanation
    The stack works on the principle of FIFO, which stands for "First-In, First-Out." This means that the first item to be inserted into the stack is the first one to be removed. The stack follows a strict order of insertion and removal, where new items are added on top of the stack and can only be removed from the top. This principle ensures that the most recently added item is always the next one to be removed, making it a fundamental characteristic of stack data structures.

    Rate this question:

  • 3. 

     Which data structure allows deleting data elements from front and inserting at rear?

    • A.

      Stacks

    • B.

      Queues

    • C.

      Deques

    • D.

      Binary search tree

    Correct Answer
    B. Queues
    Explanation
    Queues are a data structure that allows deleting data elements from the front and inserting at the rear. In a queue, the first element that is inserted is the first one to be removed, following the FIFO (First-In-First-Out) principle. This makes queues suitable for scenarios where the order of elements is important, such as processing tasks in the order they are received. Stacks, on the other hand, follow the LIFO (Last-In-First-Out) principle, where the last element inserted is the first one to be removed. Deques and binary search trees do not have the specific characteristic of deleting from the front and inserting at the rear.

    Rate this question:

  • 4. 

     Identify the data structure which allows deletions at both ends of the list but insertion at only one end.

    • A.

      Input-restricted deque

    • B.

      Output-restricted deque

    • C.

      Priority queues

    • D.

      None of above

    Correct Answer
    A. Input-restricted deque
    Explanation
    An input-restricted deque is a data structure that allows deletions at both ends of the list but only allows insertion at one end. This means that elements can be removed from either the front or the back of the deque, but new elements can only be inserted at one end (either the front or the back). This restriction on insertion allows for efficient removal operations, but limits the flexibility of inserting new elements.

    Rate this question:

  • 5. 

     Which of the following data structure is non-linear type?

    • A.

      Strings

    • B.

      Lists

    • C.

      Stacks

    • D.

      None of above

    Correct Answer
    D. None of above
    Explanation
    The correct answer is "None of above." This is because all the options provided (Strings, Lists, and Stacks) are linear data structures, meaning that the elements are arranged in a linear sequence. However, the "None of above" option indicates that there is another data structure that is non-linear, which is not specified in the given question.

    Rate this question:

  • 6. 

    The elements of an array are stored successively in memory cells because

    • A.

      by this way computer can keep track only the address of the first element and the addresses of other elements can be calculated

    • B.

      The architecture of computer memory does not allow arrays to store other than serially

    • C.

      Both of above

    • D.

      none of above

    Correct Answer
    A. by this way computer can keep track only the address of the first element and the addresses of other elements can be calculated
    Explanation
    The elements of an array are stored successively in memory cells because by this way computer can keep track only the address of the first element and the addresses of other elements can be calculated. This allows for efficient memory management as the computer only needs to know the starting address of the array and can easily calculate the address of any element based on its index. This sequential storage also allows for faster access to array elements as they are stored in contiguous memory locations.

    Rate this question:

  • 7. 

    The memory address of the first element of an array is called

    • A.

      Floor address

    • B.

      Foundation address

    • C.

      First address

    • D.

      Base address

    Correct Answer
    D. Base address
    Explanation
    The memory address of the first element of an array is referred to as the base address. This is because the base address is the starting point or foundation of the array in memory. It is used to access and manipulate the elements of the array by adding an offset or index to it. The base address is crucial in determining the location of each element within the array.

    Rate this question:

  • 8. 

    Which of the following is not the required condition for binary search algorithm?

    • A.

      The list must be sorted

    • B.

      There should be the direct access to the middle element in any sublist

    • C.

      There must be mechanism to delete and/or insert elements in list

    • D.

      none of above

    Correct Answer
    C. There must be mechanism to delete and/or insert elements in list
    Explanation
    The correct answer is "There must be mechanism to delete and/or insert elements in list." This is because binary search is a searching algorithm that works by repeatedly dividing the search interval in half. It is most efficient when working with sorted lists. The direct access to the middle element and the ability to delete or insert elements are not necessary conditions for the binary search algorithm to work correctly.

    Rate this question:

  • 9. 

    Which of the following is not a limitation of binary search algorithm?

    • A.

      Must use a sorted array

    • B.

      requirement of sorted array is expensive when a lot of insertion and deletions are needed

    • C.

      there must be a mechanism to access middle element directly

    • D.

      binary search algorithm is not efficient when the data elements are more than 1000.

    Correct Answer
    D. binary search algorithm is not efficient when the data elements are more than 1000.
    Explanation
    The given answer states that the binary search algorithm is not efficient when the data elements are more than 1000. This means that the algorithm may become slower and less effective when searching through a large number of data elements. However, it is important to note that this is not a limitation of the binary search algorithm itself, but rather a limitation in terms of its efficiency in certain scenarios. The other options mentioned in the question, such as the requirement of a sorted array and the need for a mechanism to access the middle element directly, are actual limitations of the binary search algorithm.

    Rate this question:

  • 10. 

    Two dimensional arrays are also called

    • A.

      tables arrays

    • B.

      Matrix arrays

    • C.

      Both of above

    • D.

      None of above

    Correct Answer
    C. Both of above
    Explanation
    Two-dimensional arrays are also called tables arrays and matrix arrays because they are structured in a tabular form with rows and columns, similar to a table or a matrix. They allow for the storage and manipulation of data in a grid-like structure, making them suitable for organizing and accessing data that has multiple dimensions. Therefore, the correct answer is both of above.

    Rate this question:

  • 11. 

     A variable P is called pointer if

    • A.

      P contains the address of an element in DATA.

    • B.

      P points to the address of first element in DATA

    • C.

      P can store only memory addresses

    • D.

      P contain the DATA and the address of DATA

    Correct Answer
    A. P contains the address of an element in DATA.
    Explanation
    A variable P is called a pointer if it contains the address of an element in DATA. This means that P is storing the memory address of a specific element within the DATA. Pointers are used to access and manipulate data indirectly by referencing their memory locations.

    Rate this question:

  • 12. 

    Each data item in a record may be a group item composed of sub-items; those items which are indecomposable are called

    • A.

      Elementary items

    • B.

      Atoms

    • C.

      Scalars

    • D.

      All of above

    Correct Answer
    D. All of above
    Explanation
    The correct answer is "all of above". This is because each data item in a record may be a group item composed of sub-items, which are called elementary items. Additionally, indecomposable items are also called atoms, and scalars are individual values that cannot be divided into smaller components. Therefore, all of these terms accurately describe the different types of data items in a record.

    Rate this question:

  • 13. 

    Which of the following statement is false?

    • A.

      Arrays are dense lists and static data structure

    • B.

      Data elements in linked list need not be stored in adjecent space in memory

    • C.

      pointers store the next data element of a list

    • D.

      Linked lists are collection of the nodes that contain information part and next pointer

    Correct Answer
    C. pointers store the next data element of a list
    Explanation
    The given statement is false because pointers do not store the next data element of a list. Pointers store the memory address of the next node in a linked list, allowing for the traversal of the list. The actual data element is stored within each node of the linked list.

    Rate this question:

  • 14. 

    The depth of a complete binary tree is given by

    • A.

      Dn = n log2n

    • B.

      Dn = n log2n+1

    • C.

      Dn = log2n

    • D.

      Dn = log2n+1

    Correct Answer
    D. Dn = log2n+1
    Explanation
    The correct answer is Dn = log2n+1. This is because the depth of a complete binary tree is determined by the number of nodes, which is represented by n. The logarithm base 2 of n gives the height of the tree, and adding 1 to the height gives the depth. Therefore, Dn = log2n+1.

    Rate this question:

  • 15. 

    An algorithm that calls itself directly or indirectly is known as

    • A.

      Sub algorithm

    • B.

      Recursion

    • C.

      Polish notation

    • D.

      Traversal algorithm

    Correct Answer
    B. Recursion
    Explanation
    Recursion is the correct answer because an algorithm that calls itself directly or indirectly is known as recursion. In recursion, a function solves a problem by calling itself as a subroutine, which allows the problem to be solved in smaller instances. This process continues until a base condition is reached, at which point the function stops calling itself and returns the solution. Recursion is commonly used in programming to solve problems that can be broken down into smaller, repetitive tasks.

    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 21, 2023
    Quiz Edited by
    ProProfs Editorial Team
  • Apr 02, 2012
    Quiz Created by
    Imac2013
Back to Top Back to top
Advertisement
×

Wait!
Here's an interesting quiz for you.

We have other quizzes matching your interest.