Theorietoets ADT list, stack, queue, priority queue

0.0(0)
studied byStudied by 0 people
0.0(0)
call with kaiCall with Kai
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/43

encourage image

There's no tags or description

Looks like no tags are added yet.

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced
Call with Kai

No study sessions yet.

44 Terms

1
New cards

If the array:

6, 2, 7, 13, 5, 4

is added to a queue, in the order given, which number will be the first number to be removed from the queue?

6

2
New cards

If the implementation of a queue uses the ADT list, which queue operation uses

list.retrieve(1, queueFront);

in its implementation?

getFront()

3
New cards

How is enqueue(newItem) implemented using an ADT list?

list.insert(list.getLength() + 1, newItem);

4
New cards

What operation adds a new item to a queue

enqueue

5
New cards

To initialize a queue that is represented by a circular array, back is set to ______.

MAX_QUEUE - 1

6
New cards

What operation of the ADT stack retrieves and then removes the top of the stack

pop

7
New cards

How many pointers should a link-based implementation of a queue that uses a linear linked chain have? and which ones

two, front and back

8
New cards

What behavior does the ADT stack exhibit?

last-in, first-out

9
New cards

where can items be added in a queue

only at the back of the queue

10
New cards

The ADT queue is value-oriented.

No, the priority queue is

11
New cards

The ADT sorted list inserts and deletes items by their ______.

value

12
New cards

The item that is removed first from a stack is called the what of the stack

the top of the stack

13
New cards

If the array 6, 2, 7, 13, 5, 4 is added to a stack, in the order given, which number will be the first number to be removed from the stack?

4, because a stack uses LIFO

14
New cards

A priority queue orders its items by

priority value

15
New cards

the first item to be removed from a priority queue is the item with

the highest priority value

16
New cards

What is the postfix form of the infix expression: (a + b) * c / d

a b + c * d /

17
New cards

What operation is used to delete something in an ADT list

remove

18
New cards

what operation in the ADT stack is similar to the enqueue operation of the ADT queue

push

19
New cards

Where can items be added in an ADT list

at any position in the list

20
New cards

What can be used to preserve the order of occurrences

a queue

21
New cards

If the array 6, 21, 35, 3, 6, 2, 13 is added to a stack, in the order given, which of the following is the top of the stack?

13

22
New cards

The ______ operation retrieves the item that was added earliest to a queue, but does not remove that item.

getFront

23
New cards

In an array-based implementation of the priority queue, the pqDelete operation returns the item in ______.

Items[size-1]

24
New cards

what does pdDelete do

25
New cards

The getTop operation of the ADT stack changes the stack.

false

26
New cards

The first item to be added to a queue is the first item to be removed from the queue.

true because it uses FIFO

27
New cards

The ADT binary search tree is value-oriented.

true

28
New cards

If a stack is used by an algorithm to check for balanced braces, which of the following is true once the end of the string is reached?

the stack is empty

29
New cards

What type of implementation is an Array-based ADT

linear

30
New cards

If the array

6, 21, 35, 3, 6, 2, 13

is added to a queue, in the order given, which of the following is the back of the queue?

13

31
New cards

the ADT binary tree is position-ortiented

true

32
New cards

If 5 items are added to a stack, the first item to be removed from the stack is the first item that was added to the stack.

false, the last item is the first that would be removed

33
New cards

does getFront change the queue

No, it only returns the item at the front of the queue

34
New cards

What behavior does the ADT queue exhibit?

first in,first out

35
New cards

is pop an ADT queue operation

No it belongs to the ADT stack

36
New cards

what ADT allows yo

37
New cards

Given the language L, where:

L = {w$w’ : w is a possibly empty string of characters other than $, w’ = reverse(w) }

is the string : XYZ$ZXY in L

No because XYZ, should be ZYX

38
New cards

Operations on a queue occur where

both its front and back

39
New cards

What ADT is value oriented

queue

40
New cards

If the implementation of a queue uses the ADT list, which queue operation uses

list.remove(1);

in its implementation?

dequeue()

41
New cards

In a pointer-based implementation of a stack, the stack can grow and shrink dynamically.

true

42
New cards

Operations of the ADT queue can be viewed as general versions of the list and stack operations.

43
New cards
44
New cards

Explore top flashcards