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
Document preview thumbnail
Preview 3 out of 21 pages
Exam (elaborations)

CSE 2221 MIDTERM 2 QUESTIONS AND ANSWERS 2025

Document preview thumbnail
Preview 3 out of 21 pages

CSE 2221 MIDTERM 2 QUESTIONS AND ANSWERS 2025

Content preview

CSE 2221 MIDTERM 2 LATEST
what is the default parameter mode? - ANSWERS-restores


what is the relationship between the input parameter and a replaces
mode parameter - ANSWERS-no relationship


when we use a parameter name in a method contract, what value are we
referencing to when the parameter is a (a) primitive type or (b) reference
type? - ANSWERS-(a) THE value
(b) object value


do we allow the following statement "nn.multiply(nn); - ANSWERS-no
this != arg


what is the simplest way to create an alias? - ANSWERS-nn1 = nn2;


how many "points of contact" do you have in harmless aliasing? i.e. how
many reference variables reference an object - ANSWERS-1


how many "points of contact" do you have in harmful aliasing? -
ANSWERS-2


END OF
PAGE
1

, CSE 2221 MIDTERM 2 LATEST
can you have duplicate entries in a string? does order of the entries
matter? - ANSWERS-yes and yes


what is the mathematical string notation for programming type String
equal to "CSE2221" what is the mathematical type of this? -
ANSWERS-<'C', 'S', 'E', 2', '2', '2', '1'> string of characters


what is the mathematical string notation for programming type int equal
to [1, 6). what is the mathematical type of this? - ANSWERS-<1, 2, 3, 4,
5> string of integers


what operator do you use to concatenate two programming Strings?
what about two mathematical strings? - ANSWERS-programming --> +
math --> *


what is the definition of a substring? give an example - ANSWERS-if A
is a substring of B, all elements of A occur in B
<1, 2> --> <7, 1, 2, 4>


what is the definition of a prefix? give an example - ANSWERS-all
elements of A occur first in B

END OF
PAGE
2

, CSE 2221 MIDTERM 2 LATEST
<1, 2> --> <1, 2, 7, 6, 11>


what is the definition of a suffix? given an example - ANSWERS-all
elements of A occur last in B
<1, 2> --> <8, 14, 1, 2>


what is "s[1, 7) of "s = Go Buckeyes!"" - ANSWERS-"o Buck"


simply put, what is recursion? - ANSWERS-a function that calls itself


what must be done in order for recursion to work? Hint: can I reverse
"Hello" right now? no, so what must I do? - ANSWERS-you must pass a
small subproblem to successive method calls


we keep doing recursive steps until we reach what? what is the
significance of this point that we have reached? - ANSWERS-base case,
it is the smallest subproblem we can solve


what is the basic structure for a recursive method? - ANSWERS-if (base
case condition) {
return some basic value
END OF
PAGE
3

Document information

Uploaded on
November 1, 2025
Number of pages
21
Written in
2025/2026
Type
Exam (elaborations)
Contains
Questions & answers
$18.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.
Teacher101
4.6
(277)
Sold
522
Followers
74
Items
11497
Last sold
3 days 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