Detailed explanation of binary tree and typical questions of force buckle

1, Types of binary trees 1. Full binary tree Except that the last layer has no child nodes, all nodes on each layer have two child node binary trees (if the depth is k, there are 2^k-1 nodes). 2. Complete binary tree Let the depth of a binary tree be H. Except for layer h, the number of nodes in other layers reaches the maximum, and all n ...

Added by xxxzom_biexxx on Mon, 31 Jan 2022 08:43:07 +0200

Redis from mastery to entry -- detailed explanation of data type List implementation source code

List introduction Each string in the List in Redis becomes an element. A List can store up to 2 ^ 32 - 1 elements. In Redis, you can insert (LPUSH) and pop-up (LPOP) at both ends of the list. You can also get the list of elements in the specified range and the elements of the specified index subscript. List is a flexible data structure, wh ...

Added by 00Sven on Mon, 31 Jan 2022 06:11:43 +0200

Eight sorting algorithms

The so-called sorting is the operation of arranging a string of records in ascending or descending order according to the size of one or some keywords. Sorting algorithm is how to arrange records according to requirements. There are roughly eight commonly used sorting algorithms: insertion sort (direct insertion sort, Hill sort), selection sort ...

Added by dsandif on Mon, 31 Jan 2022 06:07:15 +0200

Map two column set

Learning objectives Be able to tell the characteristics of Map set Save data using the Map collection add method Use the key to find value method to traverse the Map collection Traverse the Map collection using key value pairs HashMap can be used to store data of user-defined key value pairs Be able to use HashMap to write cases of landlords ...

Added by sloth456 on Mon, 31 Jan 2022 03:39:49 +0200

Usage and implementation principle of SparseArray

1, Background of SparseArray I believe everyone has used HashMap to store key value pairs. Recently, when using HashMap in the project, I found that sometimes the IDE will prompt me that the HashMap here can be replaced by SparseArray or SparseIntArray. Careful friends may also find this prompt, and will find that not all hashmaps will prompt ...

Added by Mad_T on Mon, 31 Jan 2022 03:00:17 +0200

Detailed introduction of array

catalogue 1, Concepts of sets, lists, and arrays 1. Assemble (1) Set concept (2) Three elements of set (3) Properties of sets 2. List (1) List concept (2) List features (3) Main performance 3. Index (1) Index concept (2) Advantages and disadvantages 4. Array (1) Array concept (2) The difference between array and list 2, One dime ...

Added by Xyphon on Mon, 31 Jan 2022 01:47:25 +0200

Redis learning object

1. Introduction We can see that the main data structures used in redis include: simple string (SDS), linked list, dictionary, compressed list, integer set, etc. Redis objects are implemented by these data structures. Moreover, in order to select more appropriate data structures for different objects in different use scenarios, redis has cr ...

Added by brokeDUstudent on Mon, 31 Jan 2022 00:53:48 +0200

Final review and search of data structure

I Sequential search The principle is to find = = one by one. The code is as follows int order_search(char *p){ int i = 0; while(i<3367 && strcmp(p,word[i])>0){ i++; cnt++; } cnt++; //printf("%d\n",cnt); if(strcmp(p,word[i])==0) return 1; else return 0; } Efficiency analysis: Average search length ASL: (1+...+n)/n = ...

Added by danjar on Sun, 30 Jan 2022 22:56:37 +0200

Day 4 of Leetcode data structure Introduction (array)

566. Reshaping the matrix Title Description In MATLAB, there is a very useful function reshape, which can reshape an m x n matrix into another new matrix with different size (r x c), but retain its original data. Give you an m x n matrix represented by a two-dimensional array mat, and two positive integers r and c, which respectively rep ...

Added by Goon on Sun, 30 Jan 2022 20:59:44 +0200

Analysis of Java collection List and Map

Collection classes are stored in Java There are three main types of util package: set, list and map Collection: collection is the most basic interface of collection List, Set and QueueMap: is the basic interface of the mapping table 1, Collection List is an ordered Collection. List has three implementation classes: ArrayList, Vecto ...

Added by louisA2A on Sun, 30 Jan 2022 17:59:59 +0200