Data Structure - Interpolation, Deletion and Lookup of Single Chain Table

Chain List Introduction 1.1 Comparison of advantages and disadvantages between order table and chain table Sequence table Advantages: Any element in the table can be accessed at any time; Disadvantages: Insert and delete operations require a large number of elements to be moved. Chain Storage Linear Table Advantages: No storage unit with ...

Added by Lorik on Fri, 10 Sep 2021 10:33:56 +0300

Dynamic Programming Principle and LeetCode Solution

Catalog Three characteristics of dynamic planning: Dynamic Planning Solutions: 1. State Transition Table Method 2.State Transfer Equation Method 3.LeetCode Solutions 3.1 LeetCode 509.Fibonacci Number 3.2 LeetCode 70.Climb stairs 3.3 LeetCode 198.Raid homes and plunder houses 3.4 LeetCode 53.Maximum Subordinate Sum 3.5 LeetCode 152.Pro ...

Added by mentalfloss on Fri, 10 Sep 2021 08:19:02 +0300

Infix to suffix calculation

preface          Infix expression is the expression we often use in addition, subtraction, multiplication and division. Suffix expression is a computer-friendly expression. The computer can use two stacks to calculate the input calculation string Tip: the following is the main content of this ar ...

Added by jrolands on Fri, 10 Sep 2021 03:25:11 +0300

[data structure and algorithm, explosion]

At this time, there are only two elements in the array, so we only need to constantly compare the sizes of child elements in the two elements to obtain a complete ordered array, as shown in the following figure: This is a complete merging and sorting process. Next, let's implement it with code function mergeSort(arr) { // Combin ...

Added by WLW on Fri, 10 Sep 2021 02:13:58 +0300

c language establishes queues (sequential queue, sequential queue and chain queue)

1, Sequential queue Because the implementation of sequential queue is relatively simple, let's talk about the implementation ideas and some precautions. Sequential storage structure of queue The sequential storage structure of queue is called sequential queue. It uses a group of continuous storage units (one-dimensional array) to sto ...

Added by deepson2 on Wed, 08 Sep 2021 01:35:57 +0300

Week 1 of LeetCode

Sword finger Offer22. The penultimate node in the lin k ed list OJ link: https://leetcode-cn.com/problems/lian-biao-zhong-dao-shu-di-kge-jie-dian-lcof/ Title: enter a linked list and output the penultimate node in the linked list. In order to conform to the habit of most people, this question starts from 1, that is, the tail node of the l ...

Added by Dilbert137 on Tue, 07 Sep 2021 22:47:21 +0300

[JAVA Foundation] Simple but not simple arrays

Introduction It is believed that the little buddies who have programming basics all know the data structure of arrays. It should also be the first data structure that we come into contact with. Those who have learned C or C++ should know that arrays and pointers are closely related. What are the different features of arrays in Java without poi ...

Added by cparekh on Sat, 04 Sep 2021 19:20:02 +0300

JavaScript implements the operation of binary search tree (insert, traverse and maximum value) (ES6)

Binary tree Tree: it is a nonlinear table structure with n (n > = 0) nodes. When n=0, it is called an empty tree. In any non empty tree: There is only one root nodeWhen n > 1, the other nodes can be divided into m (M > 0) disjoint finite sets T1,T2,..., Tm. Each set itself is a tree, which is called the subtree of the root Bina ...

Added by babyrocky1 on Fri, 03 Sep 2021 04:17:05 +0300

Principle and Implementation of Jump Table

The following describes an advanced data structure based on a single-chain table, jump table.  Sort the single-chain list first, then for the ordered list For efficient lookup, jump tables can be used as a data structure. Its basic idea is the idea of dichotomous search. The precondition for jumping tables is In the light of&n ...

Added by JustinMs66 on Thu, 02 Sep 2021 02:12:16 +0300

The first common node of the two linked lists

1, Title Description Enter two acyclic single linked lists and find their first common node( Note: because the incoming data is a linked list, the prompt of error test data is displayed in other ways to ensure that the incoming data is correct) Example 1 Input: {1,2,3}, {4,5}, {6,7} Return value: {6,7} Note: the first parameter {1,2,3} r ...

Added by JennyG on Thu, 02 Sep 2021 00:09:12 +0300