CS301 Quiz 1 with Solution 2023

 CS301 Quiz 1 with Solution 2023


Here are the questions along with their respective answers:


1. To create a ___________ we link the last node with the first node in the list.

   - Answer: Circularly-linked list


2. Complete the push method code of a stack void push(int x) { A[_______] = x; }

   - Answer: A[--current]


3. Consider the following expression: P = A * B + C - D. In the above expression “-” is a _________ operator.

   - Answer: Binary


4. In which data structure elements are inserted at the back and removed from the front?

   - Answer: Queue


5. _______ is a collection of elements arranged in a linear order.

   - Answer: Stack


6. Generalized code written for a class is called:

   - Answer: Template


7. Which of the following signature of the constructor function for a stack is correct as a generic data type?

   - Answer: Template<stack T>;


8. ________ is utilized at the time of memory allocation in a dynamic manner.

   - Answer: Heap


9. Consider the linked list having data [6, 72, 35, 65, 25] stored in it. While the current pointer is pointing to the memory location having 72 stored in it. After calling add(4) function on the following linked list, the current point will point to the memory location having the value?

   - Answer: 4


10. Current pointer always points to the ___________ of the linked list.

    - Answer: current node