C + + container - set & map
Content reference: https://www.bilibili.com/video/BV1et411b73Z?p=231
set / multiset container
set container
Basic concepts
Introduction: all elements are automatically sorted when inserted Essence: set / multiset is an associative container, and the underlying structure is implemented by binary tree
Difference between set and multiset
s ...
Added by nankoweap on Mon, 17 Jan 2022 03:27:48 +0200
Underlying source code analysis of ArrayList and LinkedList
Firstly, ArrayList and LinkedList are the implementation classes under the List interface. First, briefly introduce their basic underlying implementation; Talk about their underlying structure;
1: ArrayList
It can be seen from the original code that the underlying data structure of ArrayList uses array. Moreover, because generic types can be ...
Added by rayzun on Sun, 16 Jan 2022 06:29:21 +0200
Set set framework
Set set framework
1: Set characteristics
1: The set set is not repeated
public class dome {
public static void main(String[] args) {
/**
* set Set characteristics
* 1:----set The collection is not repeated
*/
//New set set
Set<String> s=new HashSet<String>();
s.add("a");
s.add("b");
s.add("c");
s.add("a ...
Added by whansen02 on Fri, 14 Jan 2022 20:50:54 +0200
javaSE___ Collection system 06___ generic paradigm
1, Generic overview and basic usage
A: Overview of generics: java generics is essentially a parameterized type, that is, the operated data type is specified as a parameter (type parameter). This parameter type can be used in the creation of classes, interfaces and methods, which are called generic classes, generic interfaces and generic m ...
Added by wee493 on Tue, 11 Jan 2022 21:45:47 +0200
ArrayDeque source code analysis
1.ArrayDeque analysis
1.1 inheritance system
As can be seen from its name, it is a double ended Queue implemented by array. Compared with LinkedList, which is a double ended Queue implemented by linked list, ArrayDeque implements the Queue interface and is also a common class under Collection.
1.2 common methods
public interface Deque< ...
Added by appels on Sat, 08 Jan 2022 15:58:28 +0200
Set set correlation
Set
1.1 Set overview and features
Set set features:
A collection that does not contain duplicate elementsThere is no indexed method, so you can't use a normal for loop to traverse
Set set exercise
Store string and traverse
package com.fun01;
import java.util.HashSet;
import java.util.Iterator;
import java.util.Set;
/**
* @author 23389. ...
Added by shaitand on Mon, 03 Jan 2022 06:31:01 +0200
Collection, generic, List, Collections, Set, Map
Collection, generic, List, Collections, Set, Map
1, Collection collection
1.1 collection overview
Collection: a collection is a container provided in java that can be used to store multiple data.
Differences between sets and arrays:
The length of the array is fixed. The length of the collection is variable.The elements of the same type are ...
Added by sethcox on Mon, 03 Jan 2022 03:51:41 +0200
Shang Silicon Valley_ Java zero foundation tutorial (Collection:set,map) -- learning notes
1, Overview of Java collection framework
1. Understanding
1) Collection and array are structures that store multiple data, which are referred to as Java containers for short. Note: storage at this time mainly refers to memory level storage, and does not involve persistent storage (. text,. jpg,. avi, in the database).
(2) Array features ...
Added by mady on Wed, 15 Dec 2021 04:33:27 +0200
Chapter VII collection
catalogue
1. Overview of collections
2. Collection (single column)
1. Single set method
2. Between multiple sets
3. Set to array
3. List collection overview
1. ArrayList
1. Process of adding elements and capacity expansion mechanism
2. Common methods
3. Removelange() method
4. Comparator
2. LinkedList
3. Vort ...
Added by sumeet on Sun, 05 Dec 2021 20:55:13 +0200
Set learning 2 -- Map interface and its implementation class
Map interface: stored in the form of key value pairs. Key value pairs exist. Key values cannot be repeated, and value can be repeated. Methods under Map interface: Interpretation of common methods in the collection:
// V put(K key, V value) adds a key value pair to the collection
hashMap.put("A","a");
System.out.println(hash ...
Added by flight553 on Wed, 01 Dec 2021 18:03:22 +0200