CSE 114 Study Guide - Final Guide: Static Variable, String Literal, Instance Variable

81 views35 pages

Document Summary

Arrays linear search: compares the key element sequentially with each element in the array. It continues to do so until the key matches an element in the array or the array is exhausted without a match being found. Assume the array is in ascending order, binary search first compares the key with the element in the middle of the array. If the key is less than the middle element you need to continue search in only the first half of the array. When key is not found, low is the insertion point where a key would be added to maintain the order of the list, returning -low-1 indicates this. If it returns 4, you know that the key should be inserted at 3. Arrays. binarysearch(list, 1) (must import java. util. arrays) selection sort: finds the smallest number in the list and swap it with the first element. Two dimensional arrays syntax: elementtype [][] arrayrefvar = new elementtype[][];

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

Related Questions