Minimum heap maximum heap understand? To understand the application of heap in the front end

⚡ preface We all know that a tree is a data structure, but we may rarely hear of the data structure heap. In fact, heap is a special kind of complete binary tree. For the front end, we usually know the maximum heap and minimum heap, and we often use the maximum heap and minimum heap to solve various problems. For example, the K largest ...

Posted by pbdude23 on Sun, 16 Jan 2022 14:07:45 +0100

Java data structures - Understanding Complexity

catalogue I Algorithm efficiency II Time complexity 1. Concept of time complexity 2. Progressive representation of large O 3. Case analysis and calculation III Spatial complexity 1. Concept of spatial complexity 2. Case analysis and calculation IV Write at the end  I Algorithm efficiency There are two kinds of algorithm efficienc ...

Posted by biznickman on Sun, 16 Jan 2022 13:54:41 +0100

Bitmap (Java based implementation)

The so-called bitmap is to use each bit to store a certain state. It is suitable for large-scale data, but there are not many data states. It is usually used to judge whether a data store exists. Design principle: Maximize the use of memory as much as possible, and maximize the mining, utilization and performance of Java. Design idea: ...

Posted by -[ webdreamer ] on Sun, 16 Jan 2022 13:28:57 +0100

Data structure - algorithm and program design

1, Experimental purpose Understand and master the type definition method of linear table.Master the basic operations in the sequence table, including the creation of the sequence table, the addition and deletion of elements, and the basic operations such as empty and full judgment. 2, Experimental requirements [Title 1 - three methods of fun ...

Posted by dswain on Sun, 16 Jan 2022 09:22:29 +0100

Review of data structure -- three traversal methods of binary tree

Review of data structure -- traversal of binary tree stl of c + + is used here. Remember to add header files The language description may be confusing and the time is limited. It is mainly used for self review. The code problem should not be big Establishment of binary tree structure typedef struct BiTNode { char data; struct BiTNode* ...

Posted by szcieder on Sun, 16 Jan 2022 04:40:19 +0100

Joseph problem (array + queue + formula iteration + recursion)

Joseph problem (array + queue + formula iteration + recursion) The Joseph Ring problem originates from a Jewish story: The Romans captured the bridge Tapat, and 41 people hid in a cave to escape the catastrophe. Among the 41 people, the historian Josephus (Joseph) and one of his friends. The remaining 39 people decided to commit collective sui ...

Posted by QbertsBrother on Sat, 15 Jan 2022 22:59:10 +0100

Detailed solution to bit operation - 2018 CCPC Guilin station: D. Bits Reverse

Bit operation problem solution   Question source: 2018 CCPC Guilin station: D. Bits Reverse   Title Description     Topic meaning understanding input T T T groups of data, each group of data contains two integers ...

Posted by daria on Sat, 15 Jan 2022 16:01:04 +0100

Data structure and algorithm sorting

sort Sorting is an algorithm that arranges data in a certain order. The following are introduced one by one. 1, Bubble sorting Bubble sorting is to compare the elements between lists in pairs, and the large exchange position is to the right. In the first pairwise comparison, the largest element must be placed on the far right, so the second ...

Posted by enemeth on Sat, 15 Jan 2022 11:50:47 +0100

Implementation of C + + queue pointer

This article introduces the implementation of queues through linked lists and pointers. catalogue 1, Logical structure: 2, Overview: 3, Related operations: 1. Copy constructor: 2. Destructor: 3. = heavy load: 4. Air judgment: 5. Header node data: 6. Join the team: 7. Departure: 8. Print queue data: 1, Logical structure: We use th ...

Posted by wittanthony on Sat, 15 Jan 2022 07:09:17 +0100

java binary tree -- binary lookup tree

1, Binary lookup tree Each node contains a Comparable key (and related values). The key of each node is greater than that of any node in the left subtree and less than that of any node in the right subtree Each node contains a key, a value, a left link and a right link, and a node counter. The left link points to a binary search tree composed ...

Posted by mfallon on Sat, 15 Jan 2022 05:46:40 +0100