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)

CMSC 132. Sets, Maps, Hashing Questions with Correct Answers

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

CMSC 132. Sets, Maps, Hashing

Institution
CMSC 132
Course
CMSC 132

Content preview

CMSC 132. Sets, Maps, Hashing

Set data structures - answer A set is a data structure in which there is no relationship
between the elements being stored

Set- Just a collection of elements
Map- Associates values with keys
Hash table

Sets - answer- No duplicates
- No ordering of elements

Be able to add and delete elements, and test whether elements are in a set quickly
(without iterating through all of the set's elements)

Java library (Collection) set classes – answer HashSet
- Elements must implement the hash Code() method
- Implemented using hashing

LinkedHashSet
- LinkedHashSet is a HashSet supporting ordering of elements
- The elements of a LinkedHashSet will be iterated over in the order that they were
inserted

TreeSet
- Elements must be comparable (either implement Comparable or provide a
Comparator)
- The elements of a TreeSet will be iterated over in increasing (sorted) order

Finding set elements - answerFinding a matching element is based on the equals()
method

Some of Java's Set<E> Interface Methods - answerboolean add(E element)

boolean contains(Object o)

boolean remove(Object element)

boolean isEmpty()

int size()

Written for

Institution
CMSC 132
Course
CMSC 132

Document information

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

Subjects

$16.99
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


Also available in package deal

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
Follow You need to be logged in order to follow users or courses
Sold
494
Member since
3 year
Number of followers
297
Documents
21489
Last sold
1 day ago

4.0

120 reviews

5
64
4
23
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

Working on your references?

Create accurate citations in APA, MLA and Harvard with our free citation generator.

Working on your references?

Frequently asked questions