Collection learning notes and collection learning notes
BinarySearch principle:
Public static index halfSearch (List <String> list, String key)
{
Int max, min, mid;
Max = list. size ()-1;
Min = 0;
While (min <= max)
{
Mid = (max + min)> 1;
String str = list. get (mid );
Int num = str. compareTo (key );
If (num> 0)
Max = mid-1;
Else if (num <0)
Min = min + 1;
Return min; // if it is Collections. binarySearch (), it is the location after min-(Access Point)-1
}
}
--------------------
Collections. fill (list, "pp ");
Replace all elements in the set with pp
--------------------
Collections. replaceAll (list, "oldValue", "newValue ");
Same:
List. set (index, "newValue ");
----------------------
Collections. reverse (list );
----------------------
Collections. swap (list, 1, 2); // badge 1, badge 2 swap
----------------------
Collections. shuffle (list); // random list
----------------------
What kind of software is good for taking study notes?
Both the Mind Map and Wiz are good. Wiz is suitable for web-based Mind Map, which requires a certain degree of knowledge. However, you will find it extremely useful.
Type of collection
Root Interface in Collection hierarchy
Collection represents a group of objects, also known as collection elements.
All common Collection implementation classes (usually indirectly implement Collection through a sub-interface) should provide two "standard" constructor Methods: one is void (No parameter) constructor, creates an empty collection. The other is a constructor with a Collection type single parameter. It is used to create a collection with the same elements as its parameters.