Questions related to DSA Basic

  1. What is an array in DSA?
    a) An array is a linear data structure that stores elements of different data types.
    b) An array is a collection of elements, all of the same data type, arranged in contiguous memory locations.
    c) An array is a type of algorithm used for sorting.
    d) An array is a data structure used exclusively for searching.

  2. What is a stack in DSA?
    a) A stack is a linear data structure that follows the Last-In-First-Out (LIFO) principle.
    b) A stack is a linear data structure that follows the First-In-First-Out (FIFO) principle.
    c) A stack is a data structure used for sorting elements.
    d) A stack is a collection of elements sorted in ascending order.

  3. What happens when you try to pop an element from an empty stack?
    a) It results in a runtime error.
    b) The stack remains empty.
    c) The top element becomes null.
    d) The element is automatically added to the stack.

  4. What is a queue in DSA?
    a) A queue is a linear data structure that follows the Last-In-First-Out (LIFO) principle.
    b) A queue is a linear data structure that follows the First-In-First-Out (FIFO) principle.
    c) A queue is a data structure used for sorting elements.
    d) A queue is a collection of elements sorted in ascending order.

  5. What happens when you try to dequeue an element from an empty queue?
    a) It results in a runtime error.
    b) The queue remains empty.
    c) The front element becomes null.
    d) The element is automatically added to the queue.

Write your answers in the comment section

1 Like