Binary search tree debut

Recently, I have made many problems about binary search tree, and found that many problems are solved by using the properties of binary search tree, and the routines are almost the same. Here is a summary. Properties of binary search tree If its left subtree is not empty, the value of all nodes on its left subtree is less than that of its roo ...

Added by modplod on Sat, 19 Feb 2022 19:55:41 +0200

Hello, Cheng Cheng. Notes sorting (collection of knowledge points 7)

Lesson 69 search algorithm 1. Static search and dynamic search Static lookup: The data set is stable, and there is no need to add or delete elements. Dynamic lookup: In the process of finding data sets, you need to add or delete elements at the same time. 2. Search structure For static lookups: We might as well ...

Added by fatepower on Sat, 19 Feb 2022 14:51:47 +0200

Leetcode notes -- modification and construction of binary search tree in binary tree chapter

Catalogue of series articles I Array type problem solving method 1: dichotomy II Array type problem solving method 2: Double finger needle method III Array type problem solving method 3: sliding window IV Array type problem solving method 4: simulation V The basic operation and classic topics of the linked list Vi Classic title of hash tab ...

Added by kb9yjg on Sat, 19 Feb 2022 13:43:47 +0200

Binary tree [C language]

1. Trees Nonlinear data structure Trees are recursively defined Each tree is composed of root + multiple subtrees, and the subtree structure is the same Representation of trees The tree has no rules on how many children he has C + + will be easier to write Left child right brother notation struct Node { struct Node* _ ...

Added by cjconnor24 on Sat, 19 Feb 2022 10:50:28 +0200

LeetCode problem solution - dynamic programming - subsequence problem

LeetCode problem solution - dynamic programming - subsequence problem Reference: labuladong WeChat official account, hand handle brush, dynamic programming series, official account, excellent public address, recommended to everyone. In this paper, we will pick up the routine of sub sequence problem. In fact, there are two kinds of templ ...

Added by reversenorm on Sat, 19 Feb 2022 09:52:48 +0200

Data structure I (5.3 stack)

Stack As before, python doesn't actually have a basic data structure like stack, but we use the basic data structure of list to construct the operation of stack. The basic operations we involved are no different from the previous queue operation functions, but the corresponding function input parameters need to be changed. a:list #Push a.app ...

Added by grga on Sat, 19 Feb 2022 03:48:44 +0200

L2-010 row seats (25 points) (collective search and graphic analysis)

The most subtle thing in arranging a banquet is to arrange seats for all guests who come to the banquet. In any case, you can't line up two dead rivals at the same banquet table! This difficult task is now up to you. For any pair of guests, please write a program to tell the host whether they can be arranged at the same table. Input format: In ...

Added by said_r3000 on Sat, 19 Feb 2022 02:46:44 +0200

HashMap source code put() method

preface As for thread safety, the put method can expose the problem of thread safety. When two different hashcode s get the same index through hash calculation, they should form a linked list. However, if multiple threads are placed in the same index, it may be overwritten, which is when judging whether the table[index] is empty. No more nons ...

Added by fastfingertips on Sat, 19 Feb 2022 01:27:26 +0200

[data structure from bronze to king] Part 4: queue of data structure

Catalogue of series articles preface 1, Concept and structure of queue 1. Concept of queue Queue: a special linear table that only allows inserting data at one end and deleting data at the other end. The queue has a first in first out FIFO(First In First Out) into the queue: the end of the queue where the inserting operation i ...

Added by PoOP on Sat, 19 Feb 2022 00:57:44 +0200

Data structure: simple understanding of single linked list, python implementation of single linked list

Single linked list Features: the node contains only one pointer field, and the beginning and end are not connected Illustration: Noun: nounconceptHead pointerPointer to the first node in the linked list (either the head node or the first element node)Head nodeA node attached before the first node of the linked list; Only information such as ...

Added by vargadanis on Fri, 18 Feb 2022 23:15:29 +0200