Download presentation
Presentation is loading. Please wait.
1
CSE 1030: The Collection Frameworks
Mark Shtern
2
Summary Linked List Exceptions Checked/Unchecked Assertions Iterators
3
Final Exam Written Component Lab Component Static feature
Non static feature Mixing static and non-static features Aggregation and Composition Inheritance Arrays, Linked List and Collection UML Lab Component API implementation
4
Nodes and Links in a Linked List
Copyright © 2010 Pearson Addison-Wesley. All rights reserved.
5
Schema of an Insert Operation
Add - “2” Pred Curr Head 1 3 Tail 2
6
Schema of a Remove Operation
Pred Curr Head 1 2 3 Tail
7
Schema of a Contains Operation
Curr Head 1 2 3 Tail
8
Implementation of Linked List
9
linked list Implement a linked list with the following methods
Add Remove Contains Size The linked list should implement the following interfaces Iterable Serializable Cloneable
10
A Doubly Linked List Copyright © 2010 Pearson Addison-Wesley. All rights reserved.
11
Collection Map Set List
12
Implementing Classes List ArrayList, LinkedList
Set HashSet, TreeSet Map HashMap, TreeMap
13
Default List ArrayList Set HashSet Map HashMap
14
Generics List bag = new ArrayList(); bag.add(“testing”); List <Date> bag = new ArrayList<Date>(); <? extends P> or <? super C>
15
Searching and Sorting Collections sort (List<T> list)
binarySearch(List<? Extends T> list, T x)
16
Example A student DB is a collection of type.lib.Student
The DB supports Add/Edit/Delete student Query students by id, name, gpa and major Generate reports Class GPA report displays a course number and the average of all GPA grades awarded in the course Student statistic report shows number of students by major Develop the DB
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.