Tag:Sort

  • Manual golang basic data structure and algorithm heap sorting

    Time:2021-10-25

    origin Recently read < < my first algorithm book > > ([Japan] Ishida Baohui; Miyazaki Xiuyi)This series of notes is intended to use golang exercises Heap sort Heap sorting is characterized by the use of the heap in the data structure. First, store all the data in the heap and build the heap in descending […]

  • PHP common array functions and examples [basic]]

    Time:2021-10-23

    1、 Some basic operation functions of array about key name and value1. Get all keys or values of the array:array_keys() array_values() $arr_keys = array_keys($array);$arr_values = array_values($arr); 2. Exchange the positions of keys and values in the array. If the previous ones are repeated, they will be overwritten by the following ones:array_flip() $arr2 = array_flip($arr); 3. […]

  • Flink + iceberg’s real-time warehouse practice where to go

    Time:2021-10-23

    Introduction:This paper introduces some practices of qunar data platform using Flink + iceberg 0.11. Author: Yu Dong Summary:This paper introduces some practices of qunar data platform using Flink + iceberg 0.11. The contents include: Background and pain points Iceberg architecture Pain point 1: Kafka data loss Pain point 2: high pressure of hive in near […]

  • Priority process scheduling in C + + preemption

    Time:2021-10-23

    First come, first served Short process first algorithm Priority scheduling (preemption) Priority scheduling #include <iostream> #include <cstdio> #include <vector> #include <algorithm> using namespace std; struct PCB { int id; // Process ID double turnaround_ time; // Turnaround time double weighted_ turnaround_ time; // Weighted turnaround time double wait_ time; // waiting time double start_ time; […]

  • Dry goods: explain the CMP parameters of C + + sort function in detail!

    Time:2021-10-22

    On the first day of learning algorithms, you were learning bubble and bucket row When you haven’t figured out fast platoon and merge You have learned the final heap sorting and Hill sorting of data structures It can be said that ranking is a nightmare for many competition students So it was born void std::sort() […]

  • Basic data structure and algorithm merging and sorting

    Time:2021-10-22

    origin Recently read < < my first algorithm book > > ([Japan] Ishida Baohui; Miyazaki Xiuyi)This series of notes is intended to use golang exercises Merge sort The merge sort algorithm divides the sequence into two subsequences with the same length, When it is impossible to further divide (that is, there is only one data […]

  • A series of knowledge points — ten sorting algorithms implemented in Python

    Time:2021-10-22

    Write in front Sorting is the two most important concepts in search algorithm. We are searching and sorting in most cases. Scientists have made every effort to make sorting and searching faster. This article uses Python to implement the top ten sorting algorithms. Dry goods Sorting algorithms can be divided into many categories from different […]

  • MySQL ranking function implementation

    Time:2021-10-22

    Source of this articleMySQL ranking function implementationReprint, please indicate the source Now there is a need to rank all students’ scores and list their ranking. Just seeing this demand, I was a little confused and had no ideas at all. Why wouldn’t I do it if it was more difficult? Go online to query information, […]

  • Data structure — select sort

    Time:2021-10-20

    A go implementation of selective sorting package main import “fmt” //The core of selective sorting is to exchange the maximum or minimum values of the following len (ARR) – n elements in the array with the nth element for the nth time func selectSort(arr *[5]int){ for j := 0; j < len(arr) – 1; J […]

  • Manual golang basic data structure and algorithm quick sorting

    Time:2021-10-19

    origin Recently read < < my first algorithm book > > ([Japan] Ishida Baohui; Miyazaki Xiuyi)This series of notes is intended to use golang exercises Quick sort The quick sort algorithm will first randomly select a reference value (pivot) in the sequence, Then the number other than the reference value, It is divided into two […]

  • Data structure — insert sort

    Time:2021-10-19

    A go implementation of insertion sorting package main import “fmt” //Insert sort is an efficient sort algorithm second only to quick sort. Insert sort is an internal sort (memory) like bubble sort and selection sort //Unlike the other two, insert sort inserts unordered into an ordered array, so it is different from the other two […]

  • Data structure — quick sort

    Time:2021-10-18

    Quick sort is a sort algorithm with high efficiency. Its idea is mainly recursion package main import “fmt” func QuickSort(left int, right int, arr *[6]int) { l := left r := right pivot := arr[(left + right) / 2] for ; l < r; { for ; arr[l] < pivot; { l++ } for ; […]