100% satisfaction guarantee Immediately available after payment Both online and in PDF No strings attached 4.2 TrustPilot
logo-home
Exam (elaborations)

CMSC132 Midterm 2 Questions and Answers 100% Correct

Rating
-
Sold
-
Pages
4
Grade
A+
Uploaded on
23-06-2025
Written in
2024/2025

Exam of 4 pages for the course CMSC 132 at CMSC 132 (CMSC132 Midterm 2)

Institution
CMSC 132
Course
CMSC 132








Whoops! We can’t load your doc right now. Try again or contact support.

Written for

Institution
CMSC 132
Course
CMSC 132

Document information

Uploaded on
June 23, 2025
Number of pages
4
Written in
2024/2025
Type
Exam (elaborations)
Contains
Questions & answers

Content preview

CMSC132 Midterm 2

Big O Notation Ordering - answerO(1), O(log n), O(n), (n log n), O(n^2), O(n^3), O(2^n),
O(3^n), O(n!), O(n^n)

Array generics work-around - answer private T[] b = (T[]) new Object[4];

Inserting or deleting anything in an array is big - O of - answern

Syntax for parameterized type where T must be a subtype of Foo - answer<T extends
Foo>

is String[] a subtype of Object[] in Java? - answer Yes

Use a wildcard to denote "anything that extends athlete" - answer<? extends athlete>

Linear data structures - answerArray, Linked List, Doubly Linked List

Examples of abstract data types - answerList, Stack, Queue, Dequeue, Set, Map, Tree,
Priority Queue

Inserting before a cursor in a singly-linked list is big-O of - answer1

Deleting at cursor on a singly linked list is big-O of - answer1

The DE in Dequeue stands for - answerDouble ended

Queues are usually implemented using - answerLinked List and arrays

Dequeues are usually implemented using - answerDoubly Linked Lists and arrays

Load factor equation - answernumber of elements / size of the table

What is the max load factor? - answer0.75

What formula do we use to pick which bucket to add an element to? - answerbucket =
hash code % array length

What is the Java HashCode contract - answerif two objects are "equal," they must be
assigned the same hashcode

If you override equals() what else should be overridden? - answerhashCode()

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.
Dreamer252 NBursing
View profile
Follow You need to be logged in order to follow users or courses
Sold
478
Member since
2 year
Number of followers
293
Documents
21304
Last sold
1 week ago

4.0

115 reviews

5
60
4
22
3
18
2
2
1
13

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

Frequently asked questions