Moment For Technology

Sorting - Summary of the top 10 sorting algorithms

The idea of bubble sort is to compare adjacent elements in pairs. When an element is larger than the adjacent element on the right, they are swapped. When an element is less than or equal to the adjacent element on the right, the position is unchanged to achieve code optimization 1: mark whether the ordered optimization 3: ordered area optimization

Data Structures and Algorithms -- Determine if an array is ordered (improved)

Last time to write the data structure and algorithm in the sorting algorithm auxiliary tools class and three basic sorting, details see data structure and algorithm - sorting algorithm auxiliary tools to write and three basic sorting algorithms (Java implementation). But later on, when I learned other algorithms, I found that they judge whether an array is ordered

Bucket sort - Sort not based on comparison

The sort we've seen before, selection sort, bubble sort, insertion sort, merge sort, and quicksort are all comparation-based sorts, but bucket sort offers a new idea, which is sort based on the state of the data. Sort counting under the idea of bucket sort sort radix sort features bucket sort

Starter - sorting algorithm

This series of articles to "algorithm diagram" and "Learning JavaScript algorithm" two books as the core, the rest of the materials as assistance, and with the author's insights. Strive to simple, interesting language to bring everyone to appreciate the magic of this algorithmic world.

Hand-written Quicksort (JavaScript)

Implementation of thought quicksort is the fastest sorting method known in practice. Quicksort uses the idea of divide and conquer, which also means recursion in your code. Select any element in A, pivot, that serves as the base. Move elements less than the base to the left of the base to be greater than

Insertion sort

Thought insertion sort, you can think of it like we're playing poker. When we get the first card, our hand is in order. When we get the second card, we need to compare the left or right side of the first card that we put the second card in. When you get the third card, you need to insert it in the right place in order. .

Merge sort

In previous articles, we analyzed bubble sort, insertion sort, and selection sort. But their actual complexity is order n squared. Let's do merge sort this time with less time. The idea of merge sort is to use the divide-and-conquer idea, and the divide-and-conquer model has three steps on each level of recursion

Question 30: How to understand radix sort?

## What is radix sort? Basic idea: Radix sort is sorted by low order first, then collect; Then sort it in high order and collect it again; And so on, until the highest bit of intuitive expression: is to split each number according to its number of digits, each of the corresponding number of comparison sorting

About (Moment For Technology) is a global community with thousands techies from across the global hang out!Passionate technologists, be it gadget freaks, tech enthusiasts, coders, technopreneurs, or CIOs, you would find them all here.