Merge sort algorithm based on element groups

Problem description What is the merge sort algorithm for element groups? For example: If there is an array [1,2,3,4,5,6,7,8,9], {1,2,3} is a group, { 4,5,6} is a group, {7,8,9} is a group. Now we need to sort according to the first element of each group. The groups need to move together, then the array after […]

Solve TSP problem based on particle swarm algorithm in C++

Particle swarm optimization algorithm solves TSP traveling salesman problem C++ (2020.11.12)_jing_zhong’s blog-CSDN blog Hybrid Particle Swarm Optimization (PSO): C++ implements TSP problem – Zhihu (zhihu.com) 1. Principle It is another guessing algorithm. It is similar to the genetic algorithm. It also sets the number of iterations, controls when it will end, and then sets the […]

Design of segmentation algorithm for cerebral hemorrhage CT images based on FCM

Design content and requirements For CT images of cerebral hemorrhage, a segmentation algorithm is designed to automatically extract suspected hematoma areas and estimate the area of bleeding areas. Design requirements: ① Design a segmentation algorithm for CT images of cerebral hemorrhage based on the analysis of CT imaging principles; ② Can realize segmentation and extraction […]

[Algorithm] Search class – binary search algorithm

Summary of binary search algorithm Algorithm description This algorithm is a search algorithm. When you need to find an element from an ordered array, you can use this algorithm to find it. (This article assumes that the array is in ascending order) Algorithmic Thought Each time a half search is performed, the middle element value […]

Level 19 of Algorithm Clearance Village: Silver Challenge-Dynamic Programming High Frequency Problem

Silver Challenge-Dynamic Programming High Frequency Problem 1. Minimum number of coins LeetCode 322 https://leetcode.cn/problems/coin-change/description/ Idea analysis Try using backtracing If coins=[2,5,7], amount=27, during the solution process, each position can be selected from [2,5,7], so all situations can be enumerated step by step, and then the required The minimum number of coins, as shown below: From […]