COMP 250 Lecture Notes - Lecture 29: Hash Table, Iterator, Binary Search Algorithm

12 views7 pages

Document Summary

Often you don"t want to write implementation, just write data structures and algorithms for them at a high-level. When you"re talking about a list or something, you simply write down a set of operations to perform. An interface is what the user sees and uses. It gives class methods and some fields, and comments on what the methods do, like this . Interfaces are similar to adts -- the concepts are similar. It has a very specific meaning in java, it is a reserved word. Defining a method = the signature of a method. Example interface list { add(t) add(int, t) remove(int) get(int) size() void void. The list interface is part of java already, built-in. class arraylist implements interface list { add(t) { } add(int, t) { } remove(int) { } void void. T int isempty() { } get(int) { } size() { } This means that all the methods of the list interface get implemented by that class.

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