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)

Exam (elaborations) CS2114

Rating
-
Sold
-
Pages
7
Grade
A+
Uploaded on
15-03-2025
Written in
2024/2025

entails questions and answers

Institution
CS2114
Course
CS2114

Content preview

, To implement a Deque(double ended queue) with a firstNode and a lastNode reference,
which of the following underlying representations would result in a more efficient
implementation? - CORRECT ANSWERS-Double linked chain

Of the two sorting algorithms we studied in lecture, which would do less work, in terms
of comparisons and swaps, if executed upon an already sorted array? - CORRECT
ANSWERS-Insertion Sort

Advantage(s) of an inner iterator class over a separate iterator class: - CORRECT
ANSWERS-It has direct access to the ADT's data so it can execute more efficiently

For an array implementation of a list, the efficiency of remove(index) is: - CORRECT
ANSWERS-O(n)

For an array implementation of a stack, the efficient choice for the top is - CORRECT
ANSWERS-the last element in the array.

Which of the following List member methods should not be implemented for a
SortedList? - CORRECT ANSWERS-add(int newPosition, T newEntry)

Why do we use inheritance? - CORRECT ANSWERS-To have a general class with
common properties and behaviors shared by multiple more specialized classes.

A key benefit of inheritance is - CORRECT ANSWERS-an object can have several
types, it is type compatible with any of its superclasses

Encapsulation - CORRECT ANSWERS-A design principles that encloses data and
methods within a class', thereby hiding the class implementation details

abstraction - CORRECT ANSWERS-focus on what not how

client interface - CORRECT ANSWERS-what client code needs to know to use a class

implementation - CORRECT ANSWERS-all the data fields and details of method
defintions

The most efficient approach to dealing with a gap left in an array after removing an entry
from a bag is to - CORRECT ANSWERS-replace the entry being removed with the last
entry in the array and replace the last entry with null

Which of the following visibility modifiers should be used for a field in a class C if the
programmer does not want the the subclass to have direct access to the field? -
CORRECT ANSWERS-private

Written for

Institution
CS2114
Course
CS2114

Document information

Uploaded on
March 15, 2025
Number of pages
7
Written in
2024/2025
Type
Exam (elaborations)
Contains
Questions & answers

Subjects

$18.66
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
ndungwamonicah600
4.0
(2)

Get to know the seller

Seller avatar
ndungwamonicah600 Chamberlain College Of Nursing
View profile
Follow You need to be logged in order to follow users or courses
Sold
6
Member since
1 year
Number of followers
0
Documents
1647
Last sold
2 months ago

4.0

2 reviews

5
1
4
0
3
1
2
0
1
0

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