Written by students who passed Immediately available after payment Read online or as PDF Wrong document? Swap it for free 4.6 TrustPilot
logo-home
Exam (elaborations)

DATA STRUCTURES STACK EXAM WITH CORRECT ANSWERS

Rating
-
Sold
-
Pages
3
Grade
A+
Uploaded on
28-07-2025
Written in
2024/2025

DATA STRUCTURES STACK EXAM WITH CORRECT ANSWERS

Institution
DATA STRUCTURES
Course
DATA STRUCTURES

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

Written for

Institution
DATA STRUCTURES
Course
DATA STRUCTURES

Document information

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

Subjects

$11.49
Get access to the full document:

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

Get to know the seller

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 West Virginia University
Follow You need to be logged in order to follow users or courses
Sold
2921
Member since
4 year
Number of followers
1958
Documents
44266
Last sold
1 hour ago
white orchid store

EXCELLENCY IN ACCADEMIC MATERIALS ie exams, study guides, testbanks ,case, case study etc

3.6

551 reviews

5
239
4
87
3
104
2
32
1
89

Recently viewed by you

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