• 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 4 pages
Exam (elaborations)

CMSC132 Midterm 2 Questions and Answers 100% Correct

Document preview thumbnail
Preview 1 out of 4 pages

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

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()

Document information

Uploaded on
June 23, 2025
Number of pages
4
Written in
2024/2025
Type
Exam (elaborations)
Contains
Questions & answers
$17.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.
Dreamer252
4.0
(117)
Sold
497
Followers
297
Items
21575
Last sold
2 months 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