• Wrong document? Swap it for free
  • Written by students who passed
  • Immediately available after payment
  • Read online or as PDF
Sell
Where do you study
Your language
Document preview thumbnail
Preview 1 out of 3 pages
Exam (elaborations)

Data Structures Stack Exam With Correct Answers

Document preview thumbnail
Preview 1 out of 3 pages

DATA STRUCTURES STACK EXAM WITH CORRECT ANSWERS

Content preview

DATA STRUCTURES STACK EXAM
WITH CORRECT ANSWERS



T/F In the Java API class java.util.Stack<E> implements a stack; there is no Stack
interface - Correct Answers -True

T/F an array can be used for storage of a stack instead of using a Java ArrayList class -
Correct Answers -True

T/F the statement Stack<String> myStack = new Stack<String>(); defines a stack that
holds String objects - Correct Answers -True

T/F there is only one stack interface in Java - Correct Answers -False

A(n) _ is a data structure in which objects are inserted into and removed from the same
end - Correct Answers -Stack

A(n) _ is a string that reads the same in either direction: left to right or right to left -
Correct Answers -Palindrome

In terms of efficiency all stack operations using an array structure are - Correct Answers
-O(1)

The value of the following postfix expression is 12+4*3+ - Correct Answers -15

Rewrite the following statement as an infix expression 56* 10- - Correct Answers -5*6-
10

A(n) _ is a data structure with the property that only the top element is accessible -
Correct Answers –Stack
Consider the implementation of the stack using an array. What goes wrong if we try to
store the top of the stack at location [0] and the bottom of the stack at the last used
position if the array - Correct Answers -Both push and pop would require linear time

In the linked list implementation of the stack class where does the push method place
the new entry on the linked list - Correct Answers -At the head

In the array version of the stack class, which operations require linear time for their
worst case (is empty, peek, pop) - Correct Answers -None

Document information

Uploaded on
July 28, 2025
Number of pages
3
Written in
2024/2025
Type
Exam (elaborations)
Contains
Questions & answers
$11.49

Wrong document? Swap it for free Within 14 days of purchase and before downloading, you can choose a different document. You can simply spend the amount again.
Written by students who passed
Immediately available after payment
Read online or as PDF

Seller avatar
Reputation scores are based on the amount of documents a seller has sold for a fee and the reviews they have received for those documents. There are three levels: Bronze, Silver and Gold. The better the reputation, the more your can rely on the quality of the sellers work.
millyphilip
3.7
(562)
Sold
3013
Followers
1964
Items
47749
Last sold
15 hours ago



Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their tests and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can instantly pick a different document that better fits what you're looking for.

Pay as you like, start learning right away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and aced it. It really can be that simple.”

Alisha Student

Working on your references?

Create accurate citations in APA, MLA and Harvard with our free citation generator.

Working on your references?

Frequently asked questions