Search Header Logo

#19 Stacks Queues and Linked Lists

Authored by Claire Buckler

others

#19 Stacks Queues and Linked Lists
AI

AI Actions

Add similar questions

Adjust reading levels

Convert to real-world scenario

Translate activity

More...

    Content View

    Student View

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

Access all questions and much more by creating a free account

Create resources

Host any resource

Get auto-graded reports

Google

Continue with Google

Email

Continue with Email

Classlink

Continue with Classlink

Clever

Continue with Clever

or continue with

Microsoft

Microsoft

Apple

Apple

Others

Others

Already have an account?