JavaScript implementation of six sorting algorithms
This paper introduces the basic algorithm and advanced algorithm of data sorting. These algorithms only rely on arrays to store data.
Array test platform
First, we construct an array test platform class
function CArray(numElements) {
this.dataStore = [];
this.numElements = numElements;
this.toString = toString;
this.clear = cle ...
Posted by leetcrew on Sat, 02 Nov 2019 21:40:47 +0100
PHP algorithm -- binary search
Two points search
Binary Search, also known as Binary Search, is an efficient search method. However, half search requires that the linear table must adopt the sequential storage structure, and the elements in the table are ordered by keywords.
Algorithm requirements
1. Sequential storage structure must be adopted.2. The keywords must be arran ...
Posted by PHP'er on Sat, 02 Nov 2019 00:59:55 +0100
CF1168C And Reachability [structure, dp]
Title Link: Luo Gu
Title Description: give the number of $n $$a_i $, if $I < J $and $a_i & a_j > 0 $, then $I $to $J $are connected with a directed side, $q $times, and ask if it can reach $r $from $l $.
Data range: $n,q\leq 3*10^5$
A wonderful thought problem. (binary is used for the following)
Maintain two arrays, $g {i, j} $ind ...
Posted by icedude on Fri, 01 Nov 2019 16:39:38 +0100
Codeforces 1184C1. Heidi and the Turing Test (Easy)
Original question link: C1. Heidi and the Turing Test (Easy)
I'll give you a plane rectangular coordinate system, and the coordinates of some points (there are \ (4 \cdot n + 1 \). You know that there must be a square, and there is an extra point beside the square. Now please find out that point (Note: the points on each side are not less than ...
Posted by Gordicron on Fri, 01 Nov 2019 06:09:16 +0100
Sword point offer -- reverse linked list and merge two linked lists that can be sorted
The beginning: this series is based on the offer of the sword finger of niuke.com. The purpose is to understand and communicate, focusing on the record. I hope you can give me some advice!
Niuke - Sword finger offer
Article directory
1. Reverse list
2. Merge two linked lists that can be sor ...
Posted by crazy/man on Fri, 01 Nov 2019 01:53:36 +0100
MPI learning notes: matrix multiplication
Reference from: https://blog.csdn.net/lcx543576178/article/details/45892839
The procedure is slightly modified as follows:
#include<iostream>
using namespace std;
#include<mpi.h>
int main(int argc, char * argv[] ){
double start, stop;
int *a, *b, *c, *buffer, *ans;
int size = 1000;
int rank, numprocs, ...
Posted by mbabli on Thu, 31 Oct 2019 11:33:18 +0100
K - LOVER II UVALive - 8522 thinking line tree
Title Link: https://vj.ti12z.cn/33213da9be509cd5008cd64ae75e75bd?v=1562346904
Title:
Let's give you a n array of a with N length and an array of b with m length. When the sum of a[i] and b[i] is greater than or equal to k, I and j can match. Now let's give you several queries, each time I ask yo ...
Posted by adsegzy on Wed, 30 Oct 2019 22:42:50 +0100
bzoj 1977 strictly sub small spanning tree (minimum spanning tree + LCA multiplication)
Title address
Learn from the big guy's blog: https://www.cnblogs.com/AK-ls/p/10509986.html
Title Description
Recently, little C has learned many algorithms of minimum spanning tree, such as Prim algorithm, Kurskal algorithm, loop elimination algorithm, etc. Just when little C is complacent, littl ...
Posted by devil6600 on Tue, 29 Oct 2019 15:31:43 +0100
[Leetcode problem solving algorithm weekly] issue 1
First appeared in the WeChat public's front-end growth notes, written in 2019.10.28
background
This paper records the whole thinking process in the process of writing questions for reference. The main contents include:
Assumption of topic analysis
Write code validation
Consult others' solution
Thinking and summing up
Catalog
1. Sum of two nu ...
Posted by Namadoor on Mon, 28 Oct 2019 12:18:05 +0100
Page experience Optimization - picture preview and upload display progress
In normal project development, we often upload files, not only to achieve the basic needs, but also to take into account the user experience. According to the problems encountered in our work, we talk about the preview of image upload and the optimization of upload progress.
1. Construction project
Based on the project built by Vue.js+axios, ...
Posted by jamesh on Mon, 28 Oct 2019 01:41:38 +0100