Data structure - diagram

1, Basic concept of graph   Graph - graph G is composed of two sets V(G) and E(G), marked as G=(V,E), where V(G) is a non empty finite set of vertices,   E(G) is a finite set of edges, and edges are disordered or ordered pairs of vertices. Graph cannot be empty 1. Terms and definitions of drawings 1) Directed graph If E is a finite s ...

Posted by metroblossom on Fri, 05 Nov 2021 12:52:12 -0700

[problem solving report] 100 cases of introduction to C language (case 4)

  Zero, write in front          This series is not updated frequently. It's interesting to see today's topic. Let's have a look. The main knowledge points are [question 04] given a and b, ask whether a can be divided by b. The Application of if statement and conditional operatorhttps://blog.csdn.ne ...

Posted by Mew151 on Fri, 05 Nov 2021 11:24:26 -0700

Application of Binary Tree Traversal (Build Binary Tree, Find Tree Depth, Copy Binary Tree)

Establishing Binary Tree Storage Structure--Binary Chain List The same binary tree can be built in different order, which corresponds to different codes and different user inputs. The process of building a binary tree in different order is different but the final result is the same, so the binary tree can be built by traversing in order, but t ...

Posted by gatoruss on Fri, 05 Nov 2021 09:42:37 -0700

String matching in algorithm

28 implementation str () Determines whether a string is a substring of another string and returns its position. Enter a parent string and a substring, and output an integer indicating the position of the substring in the parent string. If it does not exist, return - 1. Input: haystack = "hello", need = "ll" Output: 2 ...

Posted by jlpulido on Thu, 04 Nov 2021 21:04:14 -0700

[LeetCode stack and queue]: Classic OJ questions about stack and queue (implemented in C language and explained in detail with attached drawings)

1. Bracket matching problem LeetCode link: [20. Valid brackets] This problem is a classic example of using stack to solve problems; The idea is as follows: Traverse the string. If it meets the inverted left parenthesis, it will be put on the stack. If it meets the inverted right parenthesis, it will take the element at the top of the stac ...

Posted by skicrud on Thu, 04 Nov 2021 11:34:40 -0700

[CF1007D] Ants (tree chain subdivision + 2-SAT)

Click here to see the problem There is a tree with \ (n \) points. You need to perform \ (m \) coloring operations. Each operation gives two point pairs \ ((x_1,y_1) \) and \ ((x_2,y_2) \), and you need to select a point pair to color all the edges in the path on the corresponding tree. It is required that the same edge cannot be dyed repeated ...

Posted by Andrei on Thu, 04 Nov 2021 10:57:34 -0700

Introduction to balanced tree

Introduction to balanced tree Preface: because \ (fhq \) is better than \ (splay \) in all aspects, mainly due to the small code size, the topic of this solution is \ (fhq\) \(treap \), that is, non rotating \ (treap \). Template Template question Definition and nature Balanced tree is a data structure composed of binary search tree and heap, s ...

Posted by garyr on Wed, 03 Nov 2021 14:42:51 -0700

Binary search basic topic - binary template

Binary search basis 1. Preface In the past, I always felt that I had to go through all the concepts before I could start to brush the questions. I didn't know that practice was the shortcut to master knowledge, rather than forgetting to recite it. To learn knowledge, we need to settle down and go step by step, otherwise we will be punished fo ...

Posted by SnaD on Wed, 03 Nov 2021 12:04:20 -0700

[NEFU sharp data structure] operation related to experiment 8 sorting table

[NEFU sharp data structure] operation related to experiment 8 sorting table Serious people who handwritten sort ah, brainless sort. If you are admitted to the computer sorting stage, sort will kill indiscriminately, but it's a pity that you can't arrange it. Recommended reading: [data structure] NEFU sophomore sharp experiment reference direct ...

Posted by patryn on Wed, 03 Nov 2021 11:54:59 -0700

Experiment 3 banker algorithm

Experiment 3 deadlock avoidance algorithm of process 1, Experimental purpose According to the idea of banker algorithm, write a program to solve the deadlock problem of concurrent processes. 2, Background knowledge This experiment requires the design and implementation of banker algorithm. Banker algorithm is a classic deadlock avoidance al ...

Posted by travelbuff on Tue, 02 Nov 2021 17:59:15 -0700