Basic algorithm set of graph (Java) (shortest path and minimum spanning tree)

Basic algorithm set of graph (shortest path and minimum spanning tree) 1. Shortest path algorithm (DFS Freud dijestra Bellman Ford) 1.1DFS two-point shortest path In fact, not only depth first search, but also breadth first search can solve such problems. DFS is introduced here. DFS and BFS are not much different in solving the problem of th ...

Posted by scrupul0us on Sun, 21 Nov 2021 16:21:24 -0800

Lecture 5 dynamic programming

AcWing 2. 01 knapsack problem State representation f ( i , j ) f(i, j) f(i,j) represents the optimal solution of the first i articles in the ca ...

Posted by paparanch on Sun, 21 Nov 2021 15:01:48 -0800

Morris, recursive binary tree before, during and after traversal

Experiment time: 11.10 catalogue Generating complete binary tree Implementation of Morris algorithm Introduction to morris traversal Implementation principle of morris traversal The essence of morris traversal Briefly describe the algorithm process Recursive implementation Experimental results (including time, space and output results) ...

Posted by defeated on Sun, 21 Nov 2021 13:58:54 -0800

Recursive model summary II - merge sort

1. Preface For beginners of recursion, recursion is undoubtedly difficult to understand. This series aims to analyze the recursion used in common algorithms to a certain extent, and summarize its recursion model while learning these algorithms. In order to deepen the understanding of recursion, at the same time, when we master a variety of ...

Posted by niki on Sun, 21 Nov 2021 12:33:37 -0800

Greedy algorithm C++ puzzle (leetcode101 (biscuit allocation 455 (candy allocation 135) (interval problem 435)

Basic Ideas: Local Optimal - >Global Optimal Difficulty: Determine the best "what object" Simple questions: Find money: a total of x Yuan with a minimum of several pieces of money 100 yuan 50 yuan 10 yuan 5 yuan 1 yuan Idea: x divides 100, 50, 20, 10, 5, 1 Integer division adds up leetcode 455 Allocate cookies Suppose you're a ...

Posted by amreiff on Sun, 21 Nov 2021 10:53:40 -0800

python daily algorithm | basis of data structure: stack and queue and classic maze problem

  It's not easy to create, my guest, pay attention, collect and subscribe to one button three times ❤😜          preface Program = data structure + algorithm. Algorithm is a mixture of mathematical theory and engineering implementation. It is a very interesting and magical knowle ...

Posted by kutte on Sun, 21 Nov 2021 03:31:12 -0800

Visual Basic Script program reference manual - day 2: start with a few simple codes and learn the basic and syntax of VBScript

Study several DEMO The first lecture should be basic grammar, but it seems too boring to speak seriously. Here are a few examples. DEMO1 Dim YourName ' dimension the variable YourName = InputBox("Hello! What is your name?") ' ask for the user's name MsgBox "Hello " & YourName & " ! Pleased to meet you." ' display a greeti ...

Posted by Cynix on Sun, 21 Nov 2021 03:18:31 -0800

2021-09-12 algorithm Fourth Edition: 1.1.27 binomial distribution, from 10 to 10 billion

Algorithm Fourth Edition: 1.1.27 binomial distribution, from 10 to 10 billion@ TOC Recursive method to realize binomial distribution operation, O(2^N) The recursive algorithm is relatively simple. It is very suitable for small parameters. But the problem is also obvious. N * k > 100 is very slow at the beginning. When > 1000, the progr ...

Posted by Tazerenix on Sun, 21 Nov 2021 02:13:00 -0800

Daily question: 600. Non negative integers without continuous 1

Title: Given a positive integer n, find a non negative integer less than or equal to n whose binary representation does not contain   Continuous 1   Number of. Example 1: Input: 5 Output: 5 Explanation:   The following is a nonnegative integer < = 5 with the corresponding binary representation: 0 : 0 1 : 1 2 : 10 3 : 11 4 : ...

Posted by Quilmes on Sun, 21 Nov 2021 02:01:15 -0800

Object oriented programming (unfinished)

1. What is object-oriented (1) Process oriented & object oriented Process oriented thinking: the steps are clear and simple, which is suitable for dealing with some relatively simple problems (linear thinking) Object oriented thinking: birds of a feather flock together and classify; Suitable for dealing with complex problems and problems r ...

Posted by Wakab on Sun, 21 Nov 2021 00:41:04 -0800