binary search tree

binary search tree What is a Binary Search Tree? A binary search tree is first a binary tree. This binary tree has such a feature that all nodes in the left subtree are smaller than the root node, and all nodes in the right subtree are larger than the root node. And the left and right subtrees also satisfy this condition A binary se ...

Posted by Invincible on Thu, 01 Dec 2022 19:52:09 +0300

Postorder + inorder sequence to construct binary tree

Postorder + inorder sequence to construct binary tree Input sample: The length of the input sequence in the first line is n, the input of n characters in the second line indicates the sequence of binary tree post-order traversal, and the input of n characters in the third line indicates the sequence of binary tree in-order traversal 9 GHDBEI ...

Posted by Topsy Turvey on Sun, 20 Nov 2022 02:17:57 +0300

LeetCode 232 uses a stack to implement a queue, 225 uses a queue to implement a stack

232. Implement a queue with a stack topic: Please use only two stacks to implement a first-in-first-out queue. The queue should support all operations supported by general queues (push, pop, peek, empty): Implement the MyQueue class: void push(int x) pushes element x to the end of the queueint pop() removes and returns an element from t ...

Posted by planethax on Wed, 16 Nov 2022 02:28:04 +0300

Day13. Sliding window maximum value, top K high frequency elements

Day13. Sliding window maximum value, top K high frequency elements 0239. Sliding window maximum Link: 0239. Sliding window maximum Monotonic queue: The queue is monotonic. In order to maintain this monotonicity, when adding elements to the tail of the queue, if the previous element and the current element do not satisfy the monotonic relatio ...

Posted by papacostas on Thu, 10 Nov 2022 19:11:56 +0300

leetcode brush questions (127) - 1575. Count all feasible paths

gives you an array of distinct integers, where locations[i] represents the location of the ith city. At the same time, it gives you start, finish and fuel, which respectively represent the departure city, destination city and the total amount of gasoline you have initially. In each step, if you are in city i , you can choose any city j such th ...

Posted by neonorange79 on Thu, 10 Nov 2022 01:19:00 +0300

Data Structure—Dynamic Order List

First, the concept of the sequence table *(1)* The sequence table is a linear structure in which data elements are sequentially stored in a segment of storage units with consecutive physical addresses. Generally, array storage is used. Implement various functions on arrays *(2)* Here we note that the sequence table has the word sequence b ...

Posted by echoofavalon on Wed, 12 Oct 2022 23:37:50 +0300

Step-by-step dismantling of React components - Swipe carousel

I have written one before A simplified version of the swipe carousel component , I didn't consider a lot of details and general parameter configuration at that time, the main thing was to record the implementation ideas, and there was no source code. I picked it up a few years ago, sorted it out, and packaged it into a component. There is ...

Posted by Coronach on Wed, 05 Oct 2022 12:01:14 +0300

Java Collection Framework System - The whole system of Collection and Map from practicality, comparison to underlying analysis

Java Collection Framework System Summary Notice: This article cites a large number of high-quality articles, and some of the applied ones have links to directly view the in-depth analysis of knowledge points.As for the content involving the code section, it is presented in the form of Demo + annotations. Demo mainly involves basic and common ...

Posted by mrobertson on Sun, 18 Sep 2022 21:24:48 +0300

Java advanced programming class set framework (collection class)

Introduction to the Class Set Framework     In actual development, no development can leave the array, but the traditional array is very cumbersome to use, and the length is its fatal flaw. Officially, due to the length problem, it is impossible to use it on a large scale, but it is far from being used during development. Without arrays, we ca ...

Posted by cmgmyr on Sun, 18 Sep 2022 21:19:40 +0300

R language - data structures

Dataset Concept Different industries call the rows and columns of a dataset differently. Statisticians call them observation s and variable s, database analysts call them record s and field s, and researchers in data mining and machine learning disciplines call them example s ) and attribute s. data structure R has many object types for stor ...

Posted by harishkumar09 on Sat, 17 Sep 2022 21:36:31 +0300