COMP 2402 Study Guide - Final Guide: Doubly Linked List, Java Collections Framework, Priority Queue

421 views2 pages

Document Summary

An adt is the data and operations on that data that are precisely specified independent of any implementation. A data structure is the implementation of adt. Interface: tells us what can be done implementation: is how things are done. Generics allow types to be parameters in the definitions of classes, interfaces, or methods. You don"t have to rewrite the same code for every different kind of data you want to work with. (code reuse! If required, java compiler uses type erasure to replace generics and insert type-casting. Fifo- first in first out queue (tim hortons line) Adds (enqueue) the element at the back (tail)of the queue and removes (dequeue) the element from the front (head) which was first added. Priority queue add(x)/add(x,p) adds the value of x to the queue with priority value p. remove()/deletemin() removes the element with the smallest priority.

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

Related Documents