Post-AP assignment: Java Collections Framework
After the APCS A (Java) Examination, there are often 3-5 weeks left in the semester (especially for non-seniors) — depending on when the examination is scheduled and snow days.
The Java Collections Framework is a ‘…unified architecture for representing and manipulating collections’ that goes beyond primitive arrays. It can form the introductory basis of a second-semester college data structures course. As such, it is a valuable introduction to what computing majors will see in their first year of post-secondary education.
Assignment
The assignments are to use minimal versions of the Collection and List interfaces to:
- implement a minimal version of
LinkedListand extend it to implement minimal versions ofQueueandStack.; - implement
Setusing an underlyingList, then implementHashSetusing an array as a hash table, then implementTreeSetas a binary search tree. (Sets also form the basis of various associative array data structures.)
These assignments allow exploration of implementation tradeoffs, an understanding of when each data structure is appropriate for use, and real experience coding methods that users might otherwise take for granted.
Follow the specifications in the Java Collections Framework document and complete the four Codecheck.it assignments, submitting the downloaded .ZIP files.
- http://goo.gl/Geryqc use this (minimal) Java Collections Framework
- https://codecheck.io/files/240327011161rldzj7jpy1eb7588p7synt2 implement
ArrayList - https://codecheck.io/files/2403270116y0dajd5vb922gqdfr3dses5y implement
LinkedList,Queue, andStack - https://codecheck.io/files/24032701211eggjg3du5q3h791dklg44d2g implement
Set(using aList) andHashSet(as a hash table) - https://codecheck.io/files/24032701211eggjg3du5q3h791dklg44d2g implement
TreeSetas a binary search tree
Notes
As preparation for the assignment…
- https://drive.google.com/file/d/1FY6nuXVcfMYayaSYbTciA9YmZsEgdKXa/ 2023 classroom whiteboard notes (from http://j.mp/psb_david_petty)
- https://drive.google.com/file/d/1ELECPhkhtFAWsUOwGgrOzN2q5e8Zgr24/ UML class diagram for the full Java Collections Framework (made with https://www.draw.io/)
- https://drive.google.com/file/d/1wANe9e2n44Viy3h-7eeps5mVmudaBaid/ UML class diagram for linked-list assignment:
LinkedList,Queue, andStack(made with https://www.draw.io/)
#Java