Questionnaire feedback on play / fhq Treap - [JSOI2008] Martian prefix (play), Strange Queries (fhq Treap)
[JSOI2008] Martian prefix
BZOJ1014 Good idea, hash string
But the code amount of the balanced tree is large
Note that because play joins sentinels, the ranking of each point in the balance tree is larger than the real ranking
1
1
1 (occupancy with minimum)
W ...
Posted by DaVuLf on Wed, 08 Sep 2021 01:13:24 -0700
Summary of ten sorting algorithms
Article reference: https://www.cnblogs.com/onepixel/p/7674659.html
0. Algorithm overview
0.1 algorithm classification
Ten common sorting algorithms can be divided into two categories:
Comparison sort: the relative order between elements is determined by comparison. Because its time complexity cannot exceed O(nlogn), it is also called non ...
Posted by Stripy42 on Tue, 07 Sep 2021 14:58:04 -0700
Data structure string
1. DS string application - KMP algorithm
Title Description
Learn KMP algorithm, give the main string and mode string, and find the position of mode string in the main string
The algorithm framework is as follows for reference only
input
The first input t indicates that there are t instances
The second line inputs the main string of t ...
Posted by 87dave87 on Tue, 07 Sep 2021 11:16:18 -0700
Algorithm basis - merge sort and its application
I wrote a related article two years ago: Sorting algorithm - merge sorting The reason why we have another article today is that we have a deeper understanding of this algorithm.
Algorithm analysis
Here, we will paste the dynamic diagram of merge sorting algorithm again: [external chain picture transfer failed. The source station may have anti ...
Posted by jrschwartz on Sun, 05 Sep 2021 20:58:10 -0700
[Python data structure] - chain structure
Python data structure @ EnzoReventon
Python data structure - linked structure LinkNode - single linked list
catalog:
1. Single linked list 1.1 first initialize a root node to represent the first location 1.2 define a method to add nodes at the tail 1.3 add a new node at the head of the linked list 1.4 iterators 1.5 find the content specified ...
Posted by sajidfiaz on Sun, 05 Sep 2021 20:03:56 -0700
[C + + programming problem] occupy seats
[problem description] the classroom seats in sun's school can be reserved every day. A person can occupy multiple seats and must have consecutive seats. If he can't occupy so many seats he requires, he won't want any more. In order to reduce the difficulty, seats are allocated from small to large according to the seat number each time, and seat ...
Posted by Mad_Mike on Sun, 05 Sep 2021 11:03:49 -0700
Notes on tree chain throwing points
Powered by:NEFU AB_IN
Tree chain subdivision
introduce Divide "tree" into "chain" Pre knowledge
Segment treeTreelike
d
f
s
dfs
dfs or ...
Posted by cyrenity on Sat, 04 Sep 2021 19:44:40 -0700
PAT (Grade A) 2019 autumn test 7-2 Merging Linked Lists (25 points) Ling Chen 1642
PAT (Grade A) 2019 autumn test 7-2 Merging Linked Lists (25 points)
Title Description:
Given two singly linked lists L1=a1→a2→⋯→an−1→an and L2=b1→b2→⋯→bm−1→bm. If n≥2m, you are supposed to reverse and merge the shorter one into the longer one to obtain a list like a1→a2→bm→a3→a4→bm−1⋯. For example, given one list being 6→7 and the other one 1 ...
Posted by jwinn on Sat, 04 Sep 2021 13:38:14 -0700
Common sorting algorithms
1. Bubble sorting
thought
Traverse the array. Compare and adjust the two adjacent numbers from front to back for all the numbers in the range that have not been ordered at present. The larger number sinks back and the smaller number rises forward. Each traverse will sink the largest number. The sunk numbers do not need to participate in t ...
Posted by drorgo on Fri, 03 Sep 2021 22:14:33 -0700
Hand torn TreeMap red black tree source code java implementation (based on 234B tree)
Red black tree test connection 234 tree test link
What are the advantages of red and black trees
The query performance of the red black tree is slightly inferior to that of the AVL tree, because the red black tree is slightly unbalanced compared with the AVL tree, resulting in one more layer, that is, the query performance of the red blac ...
Posted by incubi on Fri, 03 Sep 2021 16:10:57 -0700