ArrayList source code analysis

1. ArrayList inheritance and implementation structure ArrayList inherits the abstract list class AbstractList and implements the list interface and Serializable interface. public class ArrayList<E> extends AbstractList<E> implements List<E>, RandomAccess, Cloneable, java.io.Serializable 2. What is the underlying imp ...

Added by ljzxtww on Mon, 07 Feb 2022 21:39:11 +0200

Set framework - Map, set

1, Map interface Key and Value form a mapping relationship by storing data through key and Value • Map Used to save data with mapping relationship, so Map There are two sets of values stored in the collection. One set of values is used to save Map Inside Key , another group is used to save Map Inside Value • Map ...

Added by jokerbla on Mon, 07 Feb 2022 20:12:39 +0200

[data structure and algorithm] in-depth analysis of the solution idea and algorithm example of "N Queen"

1, Title Requirements The n queen problem studies how to place n queens in n × N's chessboard, and the Queens can't attack each other.Give you an integer n and return the solution of all different queen n problems.Each solution contains a different chess placement scheme for the n-queen problem, in which 'Q' and ' They represent the quee ...

Added by Wolverine68 on Sat, 05 Feb 2022 20:09:42 +0200

Introduction to Java basics Chapter 13 Java collection

catalogue Java collection framework Collection interface Iterator interface List interface and implementation class Set interface and implementation class Map interface and implementation class Collections utility class Arrays tool class Homework Java collection framework A collection is sometimes called a container. In short, it ...

Added by lauriedunsire on Fri, 04 Feb 2022 07:39:42 +0200

Java Collection - seven traversal methods of HashMap

HashMap traversal can be divided into the following four categories from a general perspective: Iterator traversal;For Each traversal mode;Lambda expression traversal (JDK 1.8 +);Streams API traversal (JDK 1.8 +). However, there are different implementation methods under each type, so the specific traversal methods can be divided into the fol ...

Added by Kunax on Wed, 02 Feb 2022 11:25:37 +0200

Deep understanding of Java collection: Research on the implementation principle of HashSet

preface Set set: specifically reflected in the non repeatable nature. The feature of this set is that it will not store duplicate elements and will store unordered elements (the order of storage and retrieval is not necessarily the same) hashset: it is a classic implementation class of set. The bottom layer is implemented by using the key val ...

Added by HAVOCWIZARD on Wed, 02 Feb 2022 06:17:00 +0200

The difference between Set and List in Java

Main differences between Set and List Duplicate elements are allowed to be inserted in the List, while duplicate elements are not allowed in the Set.Related to the storage order of elements, List is an ordered Set, which will retain the order in which elements are inserted, and Set is an unordered Set.List can be accessed by subscript, but Set ...

Added by OMorchoe on Mon, 31 Jan 2022 14:21:17 +0200

Java collection Foundation: 3 Map interface and its implementation class / Collections tool class

1, Map interface 1. Overview of map interface The Map interface is parallel to the Collection interfaceThe mapping set represented by the Map interface is used to store double column data, that is, key value (key value pair).The Map interface encapsulates the key value in a static internal class, and the two attributes of the class repres ...

Added by SoN9ne on Thu, 27 Jan 2022 23:11:28 +0200

Fundamentals of Java: Set set and HashSet principles

catalogue Set set Set overview and features [application] Use of Set [application] TreeSet set TreeSet set overview and features [application] TreeSet set basic usage [application] Use of natural sorting Comparable [application] Use of Comparator sorting Comparator [application] Summary of two comparison methods [understanding] data s ...

Added by tmed on Tue, 25 Jan 2022 21:47:04 +0200

LinkedList introduction and some source code analysis

summary _ LinkedList_ At the same time, it realizes_ List_ Interface and_ Deque_ Interface, that is, it can be regarded as a sequential container, a queue, and a stack Therefore, when you need to use queue or stack structure, you can consider using LinkedList The implementation of LinkedList determines that all operations related to subscripts ...

Added by brmcdani on Tue, 25 Jan 2022 04:52:34 +0200