From charlesreid1

(Created page with "Study guide for array data structures. ==Definitions== '''array''' - a contiguous block of memory that is fixed in size and that can be randomly accessed using integer indic...")
 
No edit summary
Line 24: Line 24:
* sort(A, comp) - sort A using the specified Comparator object
* sort(A, comp) - sort A using the specified Comparator object
* binarySearch(A,x) - perform binary search for x in A
* binarySearch(A,x) - perform binary search for x in A
==Flags==
{{ArraysFlag}}
[[Category:Study Guide]]

Revision as of 01:20, 6 July 2017

Study guide for array data structures.

Definitions

array - a contiguous block of memory that is fixed in size and that can be randomly accessed using integer indices

null - a reference to nothing, or to a non-existent memory location

Abstract Data Types/Interfaces

General

(None)

Java

Java provides an Arrays class with the following functionality:

  • equals(A,B) - boolean, true iff $ A_i = B_i \quad \forall i $
  • fill(A,x) - fills A with values x
  • copyOf(A,n) - returns an array of size n, copied from A
  • copyOfRange(A,s,t) - returns an array of size t-s, copied from corresponding indices of A
  • toString(A) - string representation of A
  • sort(A) - sort A using a tuned quicksort (see Java API Docs for implementation reference)
  • sort(A, comp) - sort A using the specified Comparator object
  • binarySearch(A,x) - perform binary search for x in A



Flags