COMS250 Exam 3

0.0(0)
studied byStudied by 0 people
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
Card Sorting

1/27

encourage image

There's no tags or description

Looks like no tags are added yet.

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced

No study sessions yet.

28 Terms

1
New cards

A(n) ________ is an abstract data type that stores and retrieves items in a last-in-first-out manner.

stack

2
New cards

True/False: The first item placed onto a stack is always the last item removed from the stack.

True

3
New cards

A dynamic stack has a _____ size, and is implemented as a(n) _____

variable,inked list

4
New cards

The ________ operation allows an item to be stored on a stack.

push

5
New cards

True/False: A dynamic stack starts as an empty linked list.

True

6
New cards

The queue data structure is commonly applied in connection with
a. managing the order of print jobs

b. communication software

c. operating systems

d. all of the above

e. none of the above

all of the above

7
New cards

Two primary queue operations are

enqueue and dequeue

8
New cards

A static queue can be implemented as a

circular array

9
New cards

A ____ stack or queue is implemented using linked lists

dynamic

10
New cards

For most people, _____ queues are more intuitive and easier to understand than _____ queues

static, dynamic

11
New cards

True/ False: Enqueue and dequeue are the two most common stack operations

False

12
New cards

True/False: A real-world example of the queue data structure can be seen in a stack of cafeteria trays, where the last tray pushed onto the stack is the first tray removed.

False

13
New cards

Stacks are useful data structures for algorithms that work with lists of items in a

last in, first out

14
New cards

Static stacks have a _____ size, and are implemented using _____.

fixed, array

15
New cards

A stack has two primary operations called

push and pop

16
New cards

The _____ operation allows an item to be removed from a stack

pop

17
New cards

True/ False: In a static stack class, the constructor function can dynamically allocate memory for the stack array

true

18
New cards

A dynamic stack may be implemented as a(n) ____, and expand or shrink with each push or pop operation

array or linked list

19
New cards

A queue is a data structure that stores and retrieve items in a _____ manner

first in, first out

20
New cards

A _____ is processed in a manner similar to customers standing in a grocery check-out line. The first customer in line

21
New cards

True/ False: Stacks and queues can be implemented as arrays or linked lists

True

22
New cards

When an element is added to a queue, it is added to the rear. When an element is removed, it is removed from the

front

23
New cards

A dynamic queue can be implemented as a

dynamic linked list

24
New cards

Queues that are implemented as arrays are called ____ queues.

static

25
New cards

True/ False: The programmer must declare in advance the size of a dynamic stack or queue

False

26
New cards

If information is transmitted faster than it can be processed, it can be held in a _____ while it awaits processing

queue

27
New cards

A practical application of the stack data type is

a. the storage of local variables in a function call

b. the tracking og the order of entry into and exit from nested loops

c. the tracking of the order of calls and returns of functions in a program

d. all of the above

e. none of the above

all of the above

28
New cards

True/ False: Push and Pop are the two most common queue operations

False