COMP 2402 Study Guide - Final Guide: Doubly Linked List, Java Collections Framework, Priority Queue
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.