MindMap Gallery Notes on knowledge point framework of common algorithms for arrays
Commonly used algorithms for arrays include one-dimensional arrays, enhanced loops, variable parameters, command line parameters, common algorithms, two-dimensional arrays, and array copy knowledge points. It is suitable for friends who organize and memorize knowledge points.
Edited at 2022-11-15 09:53:42Avatar 3 centers on the Sully family, showcasing the internal rift caused by the sacrifice of their eldest son, and their alliance with other tribes on Pandora against the external conflict of the Ashbringers, who adhere to the philosophy of fire and are allied with humans. It explores the grand themes of family, faith, and survival.
This article discusses the Easter eggs and homages in Zootopia 2 that you may have discovered. The main content includes: character and archetype Easter eggs, cinematic universe crossover Easter eggs, animal ecology and behavior references, symbol and metaphor Easter eggs, social satire and brand allusions, and emotional storylines and sequel foreshadowing.
[Zootopia Character Relationship Chart] The idealistic rabbit police officer Judy and the cynical fox conman Nick form a charmingly contrasting duo, rising from street hustlers to become Zootopia police officers!
Avatar 3 centers on the Sully family, showcasing the internal rift caused by the sacrifice of their eldest son, and their alliance with other tribes on Pandora against the external conflict of the Ashbringers, who adhere to the philosophy of fire and are allied with humans. It explores the grand themes of family, faith, and survival.
This article discusses the Easter eggs and homages in Zootopia 2 that you may have discovered. The main content includes: character and archetype Easter eggs, cinematic universe crossover Easter eggs, animal ecology and behavior references, symbol and metaphor Easter eggs, social satire and brand allusions, and emotional storylines and sequel foreshadowing.
[Zootopia Character Relationship Chart] The idealistic rabbit police officer Judy and the cynical fox conman Nick form a charmingly contrasting duo, rising from street hustlers to become Zootopia police officers!
Notes on knowledge point framework of common algorithms for arrays
Array overview
What is an array
Array is a data structure used to store "a group of data of the same type"
Array variables are reference data types
The elements in the array can be of any data type (basic types and reference types)
An array has a corresponding index, and each element in the array can be accessed through the index.
After an array is created, its size cannot be changed, but each element in the array can be changed.
one-dimensional array
statement
int a[];
int[] a1;
double b [];
Mydate[]c;
You cannot specify the length of an array when declaring it
initialization
dynamic initialization
new data type [size]
new data type []{element 1, element 2...element n}
static initialization
Initialize the array while defining it
int a[] = {1,3,5,7,9,11};
String s [] = {"a","b","c"};
Simple data type array (Refer to the memory change chart on PPT)
definition
create
Reference data type array (Refer to the memory change chart on PPT)
definition
create
initialization
Default initialization rules for array elements
Reference method of array elements: array name [subscript]
Enhance for loop
for (data type variable name: array variable name) {...}
Purpose: Only suitable for sequentially traversing and displaying the contents of all elements in an array or collection.
Defect: Index (subscript) value cannot be accessed when traversing an array or collection
variable parameter
When declaring a method .....Method name (data type... variable name)
It can accept 0-n parameters of this type. Use arrays in methods to process
Variable parameters must be written at the end of the formal parameter list, Otherwise, a compilation error will be reported.
Command line parameters
java class name abc "hello world" 123 "ni hao"
Pass parameters to (String args[]) of the main method
Commonly used algorithms
sort
Bubble Sort
selection sort
insertion sort
Find
Search sequentially, starting from the first element and searching sequentially
binary search
Prerequisite: Search in sorted array
Basic idea
code
java.util.Arrays Array operation tool class
public static void sort(int[] a);
public static int binarySearch(int[] a, int key); //Use binary search method, provided that the array has been sorted from small to large
public static String toString(int [] a) //Format the incoming array into string output
Two-dimensional array
array of arrays
initialization
static initialization
dynamic initialization
array copy
System.arraycopy(.....)
public static int[] copyOf(int[] original, int newLength) of Arrays class