Shortest path algorithm

There are two main solutions to the shortest path algorithm: 1. Dijestra algorithm for single source: One point to all points. The main feature is to take the starting point as the center and expand outward layer by layer until it reaches the end point. Dijkstra algorithm is very useful Representative shortest path algorithm Algorithm details: ...

Added by methyl_blue on Fri, 04 Mar 2022 14:06:00 +0200

Notes of the Blue Bridge Cup book (4: follow the content of the previous blue bridge cloud class, C + +)

The experiment in this section is mainly to integrate and run through the knowledge points we have learned before, and explain the actual combat through four real blue bridge cup questions, so as to lead you to apply what you have learned. One of the best lectures on the real topic of the Blue Bridge Cup Real question of 2020 Blue Bridge ...

Added by sudhakararaog on Fri, 04 Mar 2022 12:01:22 +0200

Leetcode2104: subarray range and (medium, iteration)

1. Title Description Give you an integer array nums. In nums, the range of subarray is the difference between the largest element and the smallest element in the subarray. Returns the sum of all subarray ranges in num. A subarray is a sequence of consecutive non empty elements in an array. Example 1: Input: num = [1,2,3] Output: 4 Explanatio ...

Added by gilliat on Fri, 04 Mar 2022 11:36:13 +0200

Implementation of hash table

1. Hash table Note 1 Note 2 Hash table (also known as hash table) is a data structure that is accessed directly according to the key value. That is, it accesses records by mapping key values to a location in the table to speed up the search. This mapping function is called hash function, and the array storing records is called hash table. Hash ...

Added by dcole on Fri, 04 Mar 2022 08:31:02 +0200

Recursion and divide and conquer thought 3

Link: Login - professional IT written examination interview preparation platform_ Niuke network Source: niuke.com   Middle order sequence Given the preorder traversal and postorder traversal sequences of a binary tree with n nodes, find the middle order traversal sequence. If a node has only one child node, it will be regarded as the left c ...

Added by d_mc_a on Fri, 04 Mar 2022 07:58:10 +0200

CGB2202 language foundation day 5

Language foundation day 5: Review: Scanner receives user data: 3 steps in total Branch structure: If... else if structure: multiple pathsswitch... case structure: multiple paths Advantages: high efficiency and clear structure Disadvantages: you can only judge the equality of integers break: jump out of switch Loop: repeatedly execute a ...

Added by bobby4 on Fri, 04 Mar 2022 07:20:50 +0200

One of the third written test questions of 2021TX development: Game Club

Topic overview The game club, as its name suggests, is a club composed of several small games. When players enter the club, they will get a list of games, listing the n small games open in the club today, of which the i small game must beComplete within time (assuming that the player enters the club at time 0, it only takes one unit time to st ...

Added by uramagget on Fri, 04 Mar 2022 03:28:59 +0200

Travel salesman problem--ant colony optimization algorithm solution (matlab implementation)

Today, let's share how matlab achieves an ant colony optimization algorithm to solve the traveler problem. Ant Colony Optimization (ACO) algorithm is described in detail in the last blog post. A little buddy who needs it can see it https://blog.csdn.net/HuangChen666/article/details/115827732 1. Initialize city information      1.1 Random city ...

Added by Vivid Lust on Thu, 03 Mar 2022 20:55:58 +0200

Algorithm-simulation

Preface: The so-called "simulation algorithm" used in the so-called simulation problems does not have a completely accurate definition. The analog algorithm, as the old saying goes, "Paint the ladle according to the gourd"; The official interpretation is that key elements are filtered and extracted according to the title de ...

Added by The Silent on Thu, 03 Mar 2022 19:06:03 +0200

Banker algorithm: java implementation (based on textbook)

Banker algorithm: java implementation (based on textbook) attribute Needs to be passed in the constructor Integer Resources, used for the table name and the number of available Resources. There are several Resources in totalInteger Process, used for the number of table name processes. There are several processes in totalInteger array Availab ...

Added by jasraj on Thu, 03 Mar 2022 17:30:48 +0200