WorksheetsDomande sulle Strutture Dati
Total questions: 10
Worksheet time: 5mins
What is a stack?
A data structure that follows the FIFO principle
A data structure that follows the LIFO principle (correct)
A collection of unordered elements
A type of two-dimensional array
Which operation removes the most recent element from a stack?
Enqueue
Dequeue
Push
Pop (correct)
In a queue, which operation adds an element?
Pop
Push
Enqueue (correct)
Dequeue
Which of the following statements is true regarding vectors?
Vectors can only contain integer numbers.
Vectors have a fixed size once created. (correct)
Vectors can be used to store data of different types.
Vectors cannot be dynamically sized.
What is the best data structure to implement an "undo" function?
Queue
Array
Linked list
Stack (correct)
Which of the following operations is typical of a queue?
Push
Pop
Enqueue (correct)
All of the above
If a vector has a size of 10, how many elements can it contain at most?
5
10 (correct)
11
It has no limits
Which of the following statements best describes the FIFO principle?
The last element added is the first to be removed.
The first element added is the first to be removed. (correct)
Elements can be removed in random order.
Elements can only be added at the end.
Which of the following operations is not typically supported by a stack?
Push
Pop
Peek (or Top)
Enqueue (correct)
Which of the following statements is true regarding the LIFO principle?
The first element added is the first to be removed.
The last element added is the first to be removed. (correct)
Elements can be removed in random order.
Elements can only be added to the head.
