0 basic society on the dynamic planning of editing distance (with C + + source code)

catalogue Question 1: judgment subsequence Question 2: different subsequences Question 3: deletion of two strings Question 4: editing distance Today, we continue to study the algorithm problems of dynamic programming, which are a series of algorithm problems about finding editing distance. Let's make a summary. I'll copy these problems t ...

Posted by social_experiment on Thu, 10 Mar 2022 21:51:02 +0100

Several sorting methods of arrays

Quick sort Quick sorting embodies the idea of divide and conquer. Determine the final position of a number each time, place it in the correct position, and then quickly sort the arrays at both ends in the same way through recursion. It should be noted that when using quick sort, the decision number needs to be taken randomly, which is called ...

Posted by ferronrsmith on Thu, 10 Mar 2022 17:33:18 +0100

7-7 create a binary tree for pre order sequence, output pre order sequence, middle order sequence and post order sequence, and output the number of leaf nodes (20 points)

I feel that I haven't learned the part of the tree very well. PTA encountered this problem and didn't write it out at first. After writing it, I found that it's actually very simple. Record it. In fact, what I learned is the process of writing this question That is, if you modify a structure with typedef, you can't define the structure variab ...

Posted by webosb on Thu, 10 Mar 2022 14:33:12 +0100

Under a more detailed classification, there are three common types of greedy questions

Under a more detailed classification, there are three common types of greedy questions Greed is an idea that constantly selects the local optimal solution to achieve the global optimal solution. In other words, greed is constantly making the most favorable decisions for the present. It is unrealistic to classify all greedy problems in o ...

Posted by maxat on Thu, 10 Mar 2022 14:00:19 +0100

4196 shortest path (heap optimized dijkstras algorithm template)

1. Problem Description: Given an undirected graph with n points and m edges. Points are numbered from 1 to n. The graph may contain double edges and self rings. Please find and output the shortest path from point 1 to point n. Input format The first line contains two integers n, m. The next m lines contain three integers a, b and W, indicati ...

Posted by johnwayne77 on Thu, 10 Mar 2022 10:27:14 +0100

Introduction notes of Niuke algorithm competition 5

Finally, the line segment tree and tree array. Let's send a little bit first. Please look forward to more questions. Briefly describe the segment tree: What is a segment tree? In fact, it is an interval data structure. It looks like a tree, but each node maintains the attributes of a certain interval. The root node maintains the entire inte ...

Posted by son.of.the.morning on Thu, 10 Mar 2022 08:57:35 +0100

Data structure and algorithm IV. queue

1, Queue Like a stack, a queue is a linear structure that follows a specific order in which operations are performed. The order is first in first out (FIFO). Queue structure is actually a linear structure. If further divided from the storage structure of data, the queue structure includes two types. ใƒป sequential queue structure: that is, a ...

Posted by cwiddowson on Thu, 10 Mar 2022 05:44:25 +0100

Basic Java learning - Chapter 3 array

Basic Java learning - Chapter 3 array 1, Overview of arrays 1. Definition of array An Array is a collection of multiple data of the same type arranged in a certain order, named with a name, and managed uniformly by numbering. 2. Array related concepts Array nameSubscript (index)elementLength of the array (number of elements) 3. Characteri ...

Posted by SwiftlyTilting on Wed, 09 Mar 2022 12:55:05 +0100

[Blue Bridge Cup] the "sixth move" of the 14 move sprint "Java API"

preface - ๐Ÿ€ Hello, I'm BXuan, a sophomore of software engineering who loves programming and basketball - ๐Ÿ“š Recently, in preparation for the blue bridge provincial competition in April, this chapter will talk with you about common java API s! - ๐Ÿƒ It's not hard to give up, but it must be cool to insist. Knowledge points Explanation ...

Posted by Hisakata on Wed, 09 Mar 2022 11:58:46 +0100

Challenge program design: codeforces round #776 (Div. 3) g. counting shortcuts

Title portal Main idea of the title: Given an undirected graph G without self ring and mu lt iple edges, as well as the starting point and end point S and T, the edge weight is 1, find the path length from S to T < = the number of shortest path length + 1. Problem solving ideas Since the edge weight length is constant as 1, the shortest ...

Posted by ThEMakeR on Wed, 09 Mar 2022 10:18:26 +0100