Data structure and algorithm design 4 stacks, queues and recursion

catalogue 1, Stack 1. Definition and characteristics of stack 2. Basic operation of stack and definition of class template 3. Shared stack 1. Design idea 2. Class template definition and implementation of shared stack 2, Queue 1. Definition and characteristics of queue 2. Sequential queue 1. ThUTF-8...

Posted by paulmo on Mon, 04 Oct 2021 06:07:02 +0530

Implementation of Java stack and queue

1. Stack 1.1 concept A special linear table shows the relationship between precursor and successor. Insert and delete elements are only allowed at the fixed end. The end where data is inserted and deleted is called the top of the stack and the other end is called the bottom of the stack. The daUTF-8...

Posted by Japher on Tue, 05 Oct 2021 04:54:40 +0530

DSA_ Search algorithm (java data structure and algorithm)

Introduction to search algorithm In java, there are four common Searches: Sequential (linear) lookupBinary search / half searchInterpolation lookupfibonacci search Linear search algorithm There is a number sequence: {1,8, 10, 89, 1000, 1234}. Judge whether the name [sequential search] is incluUTF-8...

Posted by NZ_Kiwi on Tue, 05 Oct 2021 05:48:54 +0530

Bidirectional linked list C language version of data structure

Bidirectional linked list C language version of data structure Data structure is used to store data. There are many kinds of data structures. This article is a two-way linked list, which is implemented in C language. learn It is useless to copy and paste the source code directly when learning tUTF-8...

Posted by Santonian on Tue, 05 Oct 2021 23:24:07 +0530

Tree array data structure details and templates (probably the most detailed)

catalogue Please indicate the source for Reprint: bestsort.cn Tree array Foundation Single point update: Interval query: Advanced operations Reverse order pair operation principle Find interval maximum Interval modification + single point query query modify Interval modification + interval queUTF-8...

Posted by Dev on Wed, 06 Oct 2021 00:00:24 +0530

Several sorts (data structures)

1. Direct insert sort basic thought In each step, insert an element to be sorted into the appropriate position of a group of elements that have been arranged in order according to the size of its sorting code until all the elements are inserted. When inserting the I (I > = 1) th element, the prUTF-8...

Posted by DaveMate on Wed, 06 Oct 2021 22:52:08 +0530

Divide and conquer algorithm - top k problem of finding large numbers

catalogue introduce The idea of fast arranging partition function The division steps of fast platoon are shown in the figure code implementation introduce For example, the problem needs to find the 10th element with the largest (small) value or the first 10 elements with the largest (small) valUTF-8...

Posted by ivalea on Thu, 07 Oct 2021 06:31:10 +0530

Explanation of time complexity

1.Programming Style Top-down programmingCoding Style 2.Time Complexity Analysis In theory, time complexity can be demonstrated by very rigorous mathematical formulas https://www.zhihu.com/question/21387264 Here we will mainly talk about how to judge the time complexity of the algorithm by obserUTF-8...

Posted by carnot on Thu, 07 Oct 2021 07:03:29 +0530

Data structure 2 - linear table - summary and sorting of knowledge points

0. Thought map of basic operation of linear table 1. What is a linear table The reason why a linear table is called a linear table is naturally because its storage form is linear. Generally speaking, for each element in the table (except the first and last element), there is only one element iUTF-8...

Posted by o3d on Thu, 07 Oct 2021 09:30:18 +0530

Learning notes: 2.3 static linked list circular linked list bidirectional linked list

2.3 static linked list circular linked list bidirectional linked list (Note: all codes have been successfully tested. Compilation environment: devC + +) 1. Static linked list The linked list described by array is called static linked list, also known as cursor implementation method. First, let UTF-8...

Posted by matthew_ellis24 on Thu, 07 Oct 2021 23:25:23 +0530