Summary of JavaScript Implementation of Top Ten Sorting Algorithms
It took weeks of intermittent practice and imitation to implement the top ten sorting algorithms using JavaScript code.
There are dynamic and static picture demonstrations of each algorithm. When you see the picture, you can implement it according to the idea of the picture first.
The text link in github, Click to see
Two-year front-end l ...
Posted by onepixel on Tue, 08 Oct 2019 07:45:15 +0200
Find the closest number of K in the sorted array
Give a target number, a non-negative integer k, an array A in ascending order. Find K integers closest to target in A. Return the number of K and rank it from small to large according to the degree of proximity to target. If the degree of proximity is the same, then the small number ranks first.
Exa ...
Posted by Cantaloupe on Tue, 08 Oct 2019 02:13:30 +0200
[Linux] Kmalloc Code Reading Records
Kmalloc Code Reading Records
Base Linux RC5.0
SLOB SLAB SLUB
static __always_inline void *kmalloc(size_t size, gfp_t flags)
{
if (__builtin_constant_p(size)) {
#ifndef CONFIG_SLOB
unsigned int index;
#endif
if (size > KMALLOC_MAX_CACHE_SIZE)
return kmalloc_large(size, flags);
#ifndef CONF ...
Posted by Fog Juice on Mon, 07 Oct 2019 21:42:28 +0200
Summer Training Diary - 8.6 (Codforce)
D. Suitable Replacement
Topic: In the S string? Convert to lowercase letters, so that string S has the largest number of disjoint strings of string T, (letters in S can be exchanged in order)
Solution: Greed
#include<bits/stdc++.h>
#define mp make_pair
using namespace std;
typedef long long ll;
t ...
Posted by Colton.Wagner on Mon, 07 Oct 2019 18:10:27 +0200
[Calculate daily] Rotate ordered arrays
Find a given integer in a rotating ordered array and return its subscript in the array?
//Conventional ordered array
int[] arr1 = {1,2,3,4,5}
//Rotating ordered array
int[] arr2 = {50,60,70,80,20,30,40}
Ideas for solving problems:
Suppose that the left-most subscript is marked by left, the right-most subscript is marked by right, and the midd ...
Posted by bouncer on Mon, 07 Oct 2019 10:44:44 +0200
Find a number in a two-dimensional array
In a two-dimensional array (each one-dimensional array has the same length), each row is sorted in the order of increasing from left to right, and each column is sorted in the order of increasing from top to bottom. Please complete a function, input such a two-dimensional array and an integer, to deter ...
Posted by kalpesh on Mon, 07 Oct 2019 09:01:57 +0200
Turntable Game Realization
Effect
thinking
1. Disk movement
Method 1:
At most 3 + 1 = 4 rows of elements appear on a three-line turntable at the same time
At first, I moved four elements in each column down at the same time. When an element moved less than the lower bound, I moved it to the top where it was invisible, so a ...
Posted by mhalloran on Mon, 07 Oct 2019 08:03:40 +0200
Link List Learning--Implementation of Single Link List-Addition and Deletion Checking
Linked list
In most cases, we will use the header node (the first node) to represent the entire list.
If we want to get the first element, we have to go through it one by one from the beginning. The average O(N) time we spend accessing elements by index, where N is the length of the list.
Implement the following functions:
get(index): Gets t ...
Posted by mikie46 on Mon, 07 Oct 2019 01:08:22 +0200
Java deep learning: thread pool principle
Thread pool features:
Reducing resources: Reducing the wastage of thread creation and destruction by reusing created threads
Enhance efficiency: When the task is completed, no waiting is required, and it is executed immediately.
Convenient Management: Unified Distribution, Tuning and Monitoring
Thread pool creation:
1.CachedThreadPool: ...
Posted by bri4n on Sat, 05 Oct 2019 20:49:09 +0200
String Multiplication
Title address
https://leetcode-cn.com/problems/multiply-strings/
Title Description: String Multiplication
Given two non-negative integers num1 and num2 in the form of strings, the product of num1 and num2 is returned, and their product is also expressed in the form of strings.
Example:
Example 1:
I ...
Posted by simply on Sat, 05 Oct 2019 19:03:21 +0200