COMPSCI 61B Lecture Notes - Lecture 16: Linked List, Binary Tree, Java Syntax

50 views7 pages
6 Mar 2019
School
Professor

Document Summary

Modified alist and sllist to implement list61b. Modified ad and lld to implement deque. With disjointsets, we saw a much richer set of possible implementations. An abstract data type (adt) is defined only by its operations, not by its implementations. Push(int x): puts x on top of the stop. Int pop(): removes and returns the top item from the stack. No resized in for linked lists, so probably a little faster. Insert(int x): inserts x into the grab bag. Int remove(): removes a random item from the bag. Int sample(): samples a random item from the bag(without removing) Int size(): number of items in the bag. Syntax differentiation between abstract data types and implementations. Interfaces in java aren"t purely abstract as they can contain some implementation details (default methods) Among the most important interfaces in the library are those that extend the collection interface (interfaces can extend other interfaces)

Get access

Grade+20% off
$8 USD/m$10 USD/m
Billed $96 USD annually
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
40 Verified Answers
Class+
$8 USD/m
Billed $96 USD annually
Class+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
30 Verified Answers

Related Documents