Data Structures and Algorithm Quiz: Arrays and Element Access
16 Questions
1 Views

Data Structures and Algorithm Quiz: Arrays and Element Access

Created by
@FineBronze

Questions and Answers

In a stack data structure, which of the following statement(s) is/are NOT correct?

  • Top of the Stack always contain the new node
  • Stack has a fixed size (correct)
  • Null link is present in the last node at the bottom of the stack
  • Stack follows FIFO principle
  • What is the purpose of GETNODE() and RETURNNODE() in a linked list?

  • Deletion and copying
  • Copying and Insertion
  • Insertion and Deletion (correct)
  • Traversing and Deletion
  • Which type of queue is based on the First In First Out (FIFO) principle?

  • Stack
  • Tree
  • Queue (correct)
  • Linked List
  • What does 'underflow' mean in the context of a stack?

    <p>Stack is empty</p> Signup and view all the answers

    Which operation is used to delete an element from a Stack?

    <p>Pop</p> Signup and view all the answers

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

    <p>Stack</p> Signup and view all the answers

    Expand LIFO.

    <p>Last In First Out</p> Signup and view all the answers

    Which data structure follows the Last In First Out (LIFO) principle?

    <p>Stack</p> Signup and view all the answers

    In general, what is the index of the first element in an array?

    <p>0</p> Signup and view all the answers

    What are the advantages of arrays?

    <p>Easier to store elements of same data type</p> Signup and view all the answers

    What is a collection of items stored at contiguous memory locations?

    <p>An array</p> Signup and view all the answers

    How do you access an element in an array?

    <p>By using the element's index</p> Signup and view all the answers

    How is the memory allocated to store the elements in a one-dimensional array?

    <p>Contiguous Block</p> Signup and view all the answers

    Which of the following creates a two-dimensional array with dimensions 2×2?

    <p>int[][] blue = new int[2, 2];</p> Signup and view all the answers

    Which operation is used to visit every single node in a list from first to last?

    <p>Traversing</p> Signup and view all the answers

    What is a two-dimensional array having the value of majority elements as null?

    <p>Sparse Matrix</p> Signup and view all the answers

    Use Quizgecko on...
    Browser
    Browser