#19 Stacks Queues and Linked Lists

#19 Stacks Queues and Linked Lists

20 Qs

quiz-placeholder

Similar activities

10 - Computação com Cloud Functions

10 - Computação com Cloud Functions

KG - University

20 Qs

Cardiac CH17

Cardiac CH17

KG - University

20 Qs

Quiz for Rice Diseases Training

Quiz for Rice Diseases Training

KG - University

18 Qs

UTS TIK KELAS X.4

UTS TIK KELAS X.4

KG - University

15 Qs

Types of ADTs

Types of ADTs

KG - University

20 Qs

Vocab Set #17: Unit 5 Waves 1

Vocab Set #17: Unit 5 Waves 1

7th Grade

15 Qs

Quiz on Informed and Uninformed Algorithms-AI-17.02.2025

Quiz on Informed and Uninformed Algorithms-AI-17.02.2025

KG - University

20 Qs

#19 Stacks Queues and Linked Lists

#19 Stacks Queues and Linked Lists

Assessment

Quiz

others

Hard

Created by

Claire Buckler

FREE Resource

20 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

1. Which properties do lists have?
A. Static and immutable
B. tatic and mutable
C. Dynamic and immutable
D. Dynamic and mutable

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

2. Which property do stacks have?
A. LILO
B. FIFO
C. FOFI
D. LIFO

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

3. Which property do queues have?
A. Items get enqueued and later dequeued
B. Items get dequeued and later enqueued
C. Items get pushed and later popped
D. Items get popped and later pushed

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

4. A stack is implemented using an array in a procedural programming language where the array uses zero-based indexing. The stack pointer always points to the top of the stack. Identify the statement which is false.
A. When the stack is empty the stack pointer can be set to -1
B. When an item is pushed to the stack, the data value is written to the element pointed to by the stack pointer, then the stack pointer is incremented
C. When the stack is full, the integer value of the stack pointer will be 1 less than the length of the array
D. When popping a value from the stack, it is important to firstly check the value of the stack pointer to ensure that the stack is not empty

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

5. A queue is implemented using an array of strings in a procedural programming language where the array uses zero-based indexing. The length of the array is set to 2000 and all elements are set to null values before strings start to get enqueued and dequeued. The program works left to right through the array. Which of the following statements is false?
A. Unless the programmer develops an algorithm based on the concept of a circular queue, the front of the queue will never be found to the right of the back of the queue in the array
B. After some strings have been enqueued, on the first occasion where a string is dequeued it will definitely be from array index 0
C. Since this is a queue of strings, no pointer is needed for the back of the queue because it will simply be a case of locating the first null pointer and this will reveal where the queue ends
D. The programmer has the option of either nudging all values to the left each time a value is dequeued (so index 0 is always the front of a non- empty queue), or just allow the queue to have its front and back indicated by two pointers (integer variables)

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Media Image
6. Study the following array of characters being used to implement a queue. Which of the operations below are impossible?
A. Enqueue 'j' and 'm' and then dequeue 'z'
B. Enqueue 'c' and dequeue 'z' then 'p'
C. Dequeue 'w' then enqueue 's', 'v' and 'q
D. Dequeue 'z' then enqueue 'y' and 's'

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Media Image
7. Study the following array of integers being used to implement a queue. Which of the statements below is true?
A. There are six items in the queue
B. The queue has to be sorted before it can be of use
C. The only value that can be dequeued is 88
D. The value 81 joined the queue the most recently

Create a free account and access millions of resources

Create resources
Host any resource
Get auto-graded reports
or continue with
Microsoft
Apple
Others
By signing up, you agree to our Terms of Service & Privacy Policy
Already have an account?