[advanced data structure] [algorithm notes] segment tree

Segment tree Introduction: segment tree is a data structure commonly used in algorithm competition to maintain interval information. The segment tree can realize single point modification, interval modification, interval query (interval summation, interval maximum and interval minimum) within the time complexity of O(logN). The article only ...

Posted by fluteflute on Fri, 03 Dec 2021 19:00:07 +0100

[solution] Luogu-P4774 [NOI2018] Dragon Slayer

If you fight with a dragon for too long, you will become a dragon. If you stare at the abyss too long, the abyss will stare back. ​ —— Nietzsche's the other side of good and evil P4774 [NOI2018] Dragon Slayer \(\text{Description}\) Players need to kill \ (n \) dragons in the order of number \ (1 \to n \), ...

Posted by kobayashi_one on Fri, 03 Dec 2021 14:37:01 +0100

Sequential storage and implementation of linear tables

1. Sequential storage representation of linear tables Sequential storage: A storage structure that is logically and physically adjacent. A set of memory cells with consecutive addresses stores data elements in a linear table in turn. This can be done with a static array V[n] or a dynamic array. Address calculation formula: LOC(ai) = LOC(a0) ba ...

Posted by trace on Thu, 02 Dec 2021 19:06:31 +0100

C Language Chain List Foundation Must Brush 21 Questions - Triple Hammer (Middle)

   🌕 Write before 🍊 Blog Home Page: The Background of kikoking's Rivers and Lakes🎉 Welcome to your attention 🔎 Give the thumbs-up 👍 Collection ⭐ Message 📝🌟 This article was originally created by kikokingzz and started by CSDN!📆 Start time: 🌹 02 December 2021 🌹🆕 Latest update time: 🎄 02 December 2021 🎄✉️ Persistence a ...

Posted by Eng65 on Thu, 02 Dec 2021 18:43:28 +0100

Design and implementation of reservoir algorithm

Author: Grey Original address: Design and implementation of reservoir algorithm Problems to be solved Suppose there is a machine that spits out different balls from source to source, and there is only a bag containing 10 balls. Each spit out ball is either put into the bag or thrown away forever. How to make sure that after the machine sp ...

Posted by leszczu on Wed, 01 Dec 2021 20:04:23 +0100

Learning notes: File class

Learning content: File class 1. Overview of the File class 1.1. File class has nothing to do with the "four families". File is only an abstract representation of path name, so file class cannot read and write files. 1.2. File object is an abstract representation of file and folder (directory) path names. A file object corresponds to ...

Posted by xeel on Wed, 01 Dec 2021 08:51:17 +0100

Easy Minesweeper Game

I believe that everyone has played a minesweeper game. After learning the two-dimensional array, I also wrote a simple Minesweeper game rule in c language as follows: 1. Set the game's board size by using macro Row and macro List (Row and List are 12 If you want to play 10x10 minesweeper); 2. Set the number of mines in the board by macro Boom ...

Posted by veroaero on Wed, 01 Dec 2021 06:59:05 +0100

Data structure | implementation of linked list

In the linear list, in addition to the important structure of sequential list, there is also the chain structure, which is also what we often call the chain list. Generally, each node of the linked list is represented by defining a structure (class). Generally speaking, the nodes of the linked list will have data fields and address field ...

Posted by goldages05 on Tue, 30 Nov 2021 16:27:50 +0100

4, Notes on data structure of postgraduate entrance examination -- basic knowledge of stack and queue (understanding of stack and queue, confusing points, familiar code)

1, Refining the concept of stack and queue Both stack and queue are linear tables with limited operation, which are linear structures. The logical structure is the same.The stack is summarized as LIFO (last in, first out); The queue is summarized as FIFO (first in first out)For the stack, n different elements, the number of different permutati ...

Posted by parag on Tue, 30 Nov 2021 15:58:55 +0100

438. Find all the letter ectopic words in the string

438. Find all letter words in the string Medium difficulty Given two strings S and p, find the substrings of all ectopic words of p in s, and return the starting indexes of these substrings. The order in which answers are output is not considered. Ectopic words refer to strings formed by rearrangement of the same letters (including the sa ...

Posted by andylai on Sun, 28 Nov 2021 18:19:39 +0100