DOC PREVIEW
USC CSCI 455x - Code Handout

This preview shows page 1 out of 2 pages.

Save
View full document
Premium Document
Do you want full access? Go Premium and unlock all 2 pages.
Access to all documents
Download any document
Ad free experience

Unformatted text preview:

Code Handout to accompany the Final Exam CSCI 455 S18 Bono Java Select Java Scanner and File constructors public File String pathname Creates File object from given pathname Does not open any file on disk public Scanner File source throws FileNotFoundException Constructs a new Scanner that produces values scanned from the specified file FileNotFoundException a checked exception is thrown if source file is not found on disk Java Set ElmtType Interface The classes that implement this interface are TreeSet and HashSet Selected methods boolean contains ElmtType elmt Returns true iff elmt is in the set int size Returns number of elements in the set boolean add ElmtType elmt Ensures that elmt is in the set Returns true iff the set changed as a result of this call boolean remove ElmtType elmt Removes elmt from the set Returns true iff the set changed as a result of this call boolean isEmpty Returns true iff the set contains no elements Iterator ElmtType iterator Returns an iterator over the elements in the set Java Iterator ElmtType Interface Selected methods boolean hasNext Returns true iff the iteration has more elements ElmtType next Returns the next element in the iteration Each successive call returns a different element in the underlying collection Java MazeCoord Class Selected methods MazeCoord int row int col Creates a maze coordinate object with the given row and column int getRow Returns the row of the coordinate int getCol Returns the column of the coordinate more on other side Code Handout to accompany the Final Exam CSCI 455 S18 Bono C Node type and ListType this is the only part of the code handout with C code struct Node int data Node next Node int item create a Node with the given value and NULL next field create a Node with the given data value item and next field n Node int item Node n typedef Node ListType more on other side


View Full Document

USC CSCI 455x - Code Handout

Download Code Handout
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view Code Handout and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Code Handout and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?