Data Structures and UML Diagrams Review, Exams of Computer Science

A concise review of key concepts related to data structures and uml diagrams, focusing on their application in computer science. It covers sequence diagrams, uml diagrams, maps, array lists, linked lists, sets, and hash codes. Examples and explanations relevant to understanding and implementing these concepts, making it a useful resource for students studying data structures and object-oriented design. It also touches on testing exceptions and the properties of different data structures, such as lists and sets, offering a quick reference for exam preparation or review. Useful for university students.

Typology: Exams

2024/2025

Available from 07/29/2025

mad-grades
mad-grades 🇺🇸

3.7

(3)

9.2K documents

1 / 3

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
CPSC 210 - Midterm 2 Questions with
complete solution 2025
Sequence Diagram - correct answer One with lifelines and each object
UML diagram - correct answer Tree-like representation of relationship
between classes (check fields) then check body for associations
Map - correct answer Map<key, value> newMapCreation = new HashMap<>;
Adding something to a Map - correct answer this.BLANK.put(key,value);
testing exceptions - correct answer Should leave blanks where the right thing
is happening and include all the asserts after the try catch blocks
Extends Arrow - correct answer straight arrow with open arrow head
Implements Arrow - correct answer dotted with open arrow head
Association arrow has a field of B - correct answer straight line normal arrow
head with 1
Associate of a list of B - correct answer straight line normal arrow head with
0..* or 1...* depending on if list is initialized with one item or null
Aggregation (A is a part of B ) - correct answer diamond at bottom of arrow
pf3

Partial preview of the text

Download Data Structures and UML Diagrams Review and more Exams Computer Science in PDF only on Docsity!

CPSC 210 - Midterm 2 Questions with

complete solution 2025

Sequence Diagram - correct answer One with lifelines and each object UML diagram - correct answer Tree-like representation of relationship between classes (check fields) then check body for associations Map - correct answer Map<key, value> newMapCreation = new HashMap<>; Adding something to a Map - correct answer this.BLANK.put(key,value); testing exceptions - correct answer Should leave blanks where the right thing is happening and include all the asserts after the try catch blocks Extends Arrow - correct answer straight arrow with open arrow head Implements Arrow - correct answer dotted with open arrow head Association arrow has a field of B - correct answer straight line normal arrow head with 1 Associate of a list of B - correct answer straight line normal arrow head with 0..* or 1...* depending on if list is initialized with one item or null Aggregation (A is a part of B ) - correct answer diamond at bottom of arrow

Array List fast at?? - correct answer add fast? add(i) slow get (I) fast remove (i) slow Linked List fast at?? - correct answer add fast add(i) slow get I slow remove I slow List properties - correct answer Keeps order and allows duplicates Set properties - correct answer Doesn't keep order Doesn't allow duplicates Hash Set Fast? - correct answer add e remove e printing keys - correct answer map.keySet(); getting value - correct answer map.get("key") overidinf hash code - correct answer @Overridepublic boolean equals(Object o) {if (this == o) return true; if (o == null || getClass() != o.getClass()) return