

Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Community
Ask the community for help and clear up your study doubts
Discover the best universities in your country according to Docsity users
Free resources
Download our free guides on studying techniques, anxiety management strategies, and thesis advice from Docsity tutors
Material Type: Assignment; Class: Data Structures and Algorithms; Subject: Computer Science (CS); University: Jacksonville State University; Term: Summer II 2006;
Typology: Assignments
1 / 3
This page cannot be seen from the preview
Don't miss anything!
What is the corrected input if the following line is typed on a keyboard: yww←dshr←←wd←e (where ← represents the backspace character)? a) ywdswe b) ywwdwde c) ywdshwe d) ywdswd Answer: a.
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? a) 6 b) 2 c) 5 d) 4 Answer: d.
The item that is removed first from a stack is called the ______ of the stack. a) front b) top c) base d) prime Answer: b.
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? a) 2 b) 6 c) 3 d) 13 e) 35 Answer: d.
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? a) 6 b) 2 c) 5 d) 4 Answer: a.
The last-in, first-out (LIFO) property is found in the ADT ______. a) list b) stack c) queue d) tree Answer: b.
The first in, first out (FIFO) property is found in the ADT ______. a) list b) stack c) queue
d) tree Answer: c.
The ______ method of the ADT stack adds an item to the top of the stack. a) createStack b) push c) pop d) peek Answer: b.
The ______ method of the ADT stack retrieves and then removes the top of the stack. a) createStack b) push c) pop d) peek Answer: c.
The ______ method of the ADT stack retrieves the top of the stack, but does not change the stack. a) createStack b) push c) pop d) peek Answer: d.
Which of the following methods of the ADT stack accepts a parameter? a) push b) pop c) createStack d) peek Answer: a.
Which of the following strings contains balanced braces? a) ab{cde{fg}hi{jkl} b) ab{cde{fghi}j}kl} c) {abc{de}{fg}hij}kl d) {ab{cde{fgh}ijkl} Answer: c.
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? a) the stack is empty b) the stack has one “{” c) the stack has one “}” d) the stack has one “{” and one “}” Answer: a.
Which of the following operations of the ADT stack does not throw a StackException? a) push b) pop c) popAll d) peek Answer: c.
The pop operation throws a StackException when it tries to ______. a) add an item to an empty stack b) add an item to an array-based implementation of a stack that is already full