Deck 9: Sorting,stacks,and Queues

Full screen (f)
exit full mode
Question
4.Queues use the first in,first out procedure.
Use Space or
up arrow
down arrow
to flip the card.
Question
5.The bubble sort bubbles the largest number to the bottom.
Question
Use the bubble sort method to show the first pass of the following array:  Element  Values 115223317412565\begin{array} { c c } \text { Element } & \text { Values } \\1 & 15 \\2 & 23 \\3 & 17 \\4 & 12 \\5 & 65\end{array}

A)12,17,23,15,65
B)12,23,17,15,65
C)15,17,12,23,65
D)17,15,12,23,65
Question
18.When processing a queue:

A)An error occurs when adding data to the queue and the queue is filled.
B)An error occurs when deleting data from the queue and queue is empty.
C)An error occurs when the wrong option is entered.
D)All of the above.
Question
11.The bubble sort:

A)Finds the smallest value and exchanges it with the first value,then continues with the second value,third value,etc.
B)Is a system of comparisons and exchanges of adjacent elements to move the largest to the bottom of the selected group of values.
C)Is a system of comparisons and exchanges of elements that are non-adjacent.The gap is halved at each pass.
D)None of the above.
Question
Use the selection exchange method to show the first pass of the following array:
 Element  Values 115223317412565\begin{array} { c c } \text { Element } & \text { Values } \\1 & 15 \\2 & 23 \\3 & 17 \\4 & 12 \\5 & 65\end{array}

A)12,17,23,15,65
B)12,23,17,15,65
C)15,17,12,23,65
D)17,15,12,23,65
Question
7.Data structures are the various ways to store data in the computer.
Question
17.The selection exchange sort:

A)Finds the smallest value and exchanges it with the first value,then continues with the second value,third value,etc.
B)Is a system of comparisons and exchanges of adjacent elements to move the largest to the bottom of the selected group of values.
C)Is a system of comparisons and exchanges of elements that are non-adjacent.The gap is halved at each pass.
D)None of the above.
Question
3.Stacks use the first in,first out procedure.
Question
1.Sorting is done through multiple comparisons and exchanges.
Question
Given a stack,what would the final value of the stack pointer be after the following instructions were executed:
PUSH 23
PUSH 35
PUSH 42
POP X
PUSH 20
POP X
POP X
PUSH 30

A)1.
B)2.
C)3.
D)4.
E)5.
Question
20.In a queue:

A)Data is added to the top and deleted from the bottom.
B)Data is added to the bottom and deleted from the top.
C)The data in the queue is moved to the top when data is deleted.
D)The data in the queue is moved down when data is deleted.
Question
10.Queues use pushing and popping to add and delete data.
Question
2.The sorting technique that requires the least number of comparisons and exchanges is the selection-exchange method.
Question
12.When a stack is pushed:

A)The number is entered into the element number in the stack pointer,the stack pointer is then incremented.
B)The stack pointer is incremented,then the number is entered into to element number in the stack pointer.
C)The number is taken out of the stack at the element number in the stack pointer,the stack pointer is then decremented.
D)The stack pointer is decremented,then the number is taken out of the stack at the element number in the stack pointer.
Question
6.The shell sort is a modification of the selection sort.
Question
16.The Shell sort:

A)Finds the smallest value and exchanges it with the first value,then continues with the second value,third value,etc.
B)Is a system of comparisons and exchanges of adjacent elements to move the largest to the bottom of the selected group of values.
C)Is a system of comparisons and exchanges of elements that are non-adjacent.The gap is halved at each pass.
D)None of the above.
Question
21.When processing a stack:

A)Additions are at one end and deletions are at the other end.
B)Additions and deletions are both at the same end.
C)Additions are at the top and deletions are at the bottom.
D)Additions are at the bottom and deletions are at the top.
Question
8.Sorting Data means to separate data into catagories.
Unlock Deck
Sign up to unlock the cards in this deck!
Unlock Deck
Unlock Deck
1/19
auto play flashcards
Play
simple tutorial
Full screen (f)
exit full mode
Deck 9: Sorting,stacks,and Queues
1
4.Queues use the first in,first out procedure.
True
2
5.The bubble sort bubbles the largest number to the bottom.
True
3
Use the bubble sort method to show the first pass of the following array:  Element  Values 115223317412565\begin{array} { c c } \text { Element } & \text { Values } \\1 & 15 \\2 & 23 \\3 & 17 \\4 & 12 \\5 & 65\end{array}

A)12,17,23,15,65
B)12,23,17,15,65
C)15,17,12,23,65
D)17,15,12,23,65
15,17,12,23,65
4
18.When processing a queue:

A)An error occurs when adding data to the queue and the queue is filled.
B)An error occurs when deleting data from the queue and queue is empty.
C)An error occurs when the wrong option is entered.
D)All of the above.
Unlock Deck
Unlock for access to all 19 flashcards in this deck.
Unlock Deck
k this deck
5
11.The bubble sort:

A)Finds the smallest value and exchanges it with the first value,then continues with the second value,third value,etc.
B)Is a system of comparisons and exchanges of adjacent elements to move the largest to the bottom of the selected group of values.
C)Is a system of comparisons and exchanges of elements that are non-adjacent.The gap is halved at each pass.
D)None of the above.
Unlock Deck
Unlock for access to all 19 flashcards in this deck.
Unlock Deck
k this deck
6
Use the selection exchange method to show the first pass of the following array:
 Element  Values 115223317412565\begin{array} { c c } \text { Element } & \text { Values } \\1 & 15 \\2 & 23 \\3 & 17 \\4 & 12 \\5 & 65\end{array}

A)12,17,23,15,65
B)12,23,17,15,65
C)15,17,12,23,65
D)17,15,12,23,65
Unlock Deck
Unlock for access to all 19 flashcards in this deck.
Unlock Deck
k this deck
7
7.Data structures are the various ways to store data in the computer.
Unlock Deck
Unlock for access to all 19 flashcards in this deck.
Unlock Deck
k this deck
8
17.The selection exchange sort:

A)Finds the smallest value and exchanges it with the first value,then continues with the second value,third value,etc.
B)Is a system of comparisons and exchanges of adjacent elements to move the largest to the bottom of the selected group of values.
C)Is a system of comparisons and exchanges of elements that are non-adjacent.The gap is halved at each pass.
D)None of the above.
Unlock Deck
Unlock for access to all 19 flashcards in this deck.
Unlock Deck
k this deck
9
3.Stacks use the first in,first out procedure.
Unlock Deck
Unlock for access to all 19 flashcards in this deck.
Unlock Deck
k this deck
10
1.Sorting is done through multiple comparisons and exchanges.
Unlock Deck
Unlock for access to all 19 flashcards in this deck.
Unlock Deck
k this deck
11
Given a stack,what would the final value of the stack pointer be after the following instructions were executed:
PUSH 23
PUSH 35
PUSH 42
POP X
PUSH 20
POP X
POP X
PUSH 30

A)1.
B)2.
C)3.
D)4.
E)5.
Unlock Deck
Unlock for access to all 19 flashcards in this deck.
Unlock Deck
k this deck
12
20.In a queue:

A)Data is added to the top and deleted from the bottom.
B)Data is added to the bottom and deleted from the top.
C)The data in the queue is moved to the top when data is deleted.
D)The data in the queue is moved down when data is deleted.
Unlock Deck
Unlock for access to all 19 flashcards in this deck.
Unlock Deck
k this deck
13
10.Queues use pushing and popping to add and delete data.
Unlock Deck
Unlock for access to all 19 flashcards in this deck.
Unlock Deck
k this deck
14
2.The sorting technique that requires the least number of comparisons and exchanges is the selection-exchange method.
Unlock Deck
Unlock for access to all 19 flashcards in this deck.
Unlock Deck
k this deck
15
12.When a stack is pushed:

A)The number is entered into the element number in the stack pointer,the stack pointer is then incremented.
B)The stack pointer is incremented,then the number is entered into to element number in the stack pointer.
C)The number is taken out of the stack at the element number in the stack pointer,the stack pointer is then decremented.
D)The stack pointer is decremented,then the number is taken out of the stack at the element number in the stack pointer.
Unlock Deck
Unlock for access to all 19 flashcards in this deck.
Unlock Deck
k this deck
16
6.The shell sort is a modification of the selection sort.
Unlock Deck
Unlock for access to all 19 flashcards in this deck.
Unlock Deck
k this deck
17
16.The Shell sort:

A)Finds the smallest value and exchanges it with the first value,then continues with the second value,third value,etc.
B)Is a system of comparisons and exchanges of adjacent elements to move the largest to the bottom of the selected group of values.
C)Is a system of comparisons and exchanges of elements that are non-adjacent.The gap is halved at each pass.
D)None of the above.
Unlock Deck
Unlock for access to all 19 flashcards in this deck.
Unlock Deck
k this deck
18
21.When processing a stack:

A)Additions are at one end and deletions are at the other end.
B)Additions and deletions are both at the same end.
C)Additions are at the top and deletions are at the bottom.
D)Additions are at the bottom and deletions are at the top.
Unlock Deck
Unlock for access to all 19 flashcards in this deck.
Unlock Deck
k this deck
19
8.Sorting Data means to separate data into catagories.
Unlock Deck
Unlock for access to all 19 flashcards in this deck.
Unlock Deck
k this deck
locked card icon
Unlock Deck
Unlock for access to all 19 flashcards in this deck.