Tag:Sort

  • JS hybrid sorting (similar to the address book sorting in Chinese mobile operating system)

    Time:2019-12-8

    In the afternoon when the sun is shining and the most suitable for dozing, the specially mute mobile phone actually moves. You can see it right. It vibrates God (customer) calls, “the Chinese name of the device in the tree menu on the left side of the report query system cannot be sorted”. To add […]

  • Oracle’s query sorting method by day, week, month, quarter and year

    Time:2019-12-8

    Oracle queries by day, week, month, quarter and year Day — to_char (t.start_time, ‘yyyy-mm-dd’) Week — to char (t.start time, ‘yyyy’), to char (t.start time, ‘IW’) Monthly -‘to’char (t.start’time, ‘yyyy-mm’) Quarter — to char (t.start’time, ‘yyyy’), to char (t.start’time, ‘Q’) Year -‘to’char (t.start’time, ‘yyyy’) Query by day select to_char(t.start_time,’YYYY-MM-DD’) day ,count(*) from test t Where […]

  • Don’t understand the principle of Hadoop heart shuffle

    Time:2019-12-6

    It’s very important to learn from Hadoop to understand the principle of shuffle. However, I believe many people read several articles of Hadoop authoritative guide 4 and didn’t really understand its true principle. After reading this article, I believe it will be very helpful for you to understand shuffle. Official definition: the process that the […]

  • Summary of common operation methods of JavaScript array [connect, add, delete, de duplicate, sort, etc.]

    Time:2019-12-3

    This article describes the common operation methods of JavaScript array. To share with you for your reference, as follows: <!DOCTYPE html> <html lang=”en”> <head> <meta charset=”UTF-8″> < title > www.jb51.net array method < / Title > <script> var arr=[1,3,4] var arr1=[“a”,”b”,”c”] var arr2=[“d”,”e”,”f”] var arrNum=[] //1. Add one or more elements to the end of […]

  • Heap sort

    Time:2019-11-28

    The old lane is long and deep, and the old street of bluestone is printed with old marksListen to the wind and rain tonight, I don’t see the umbrella man Preface Heap sorting is one of the sorting algorithms, whose time complexity is O (n log (n)). Here is the main introductionHeap constructionAnd how to […]

  • Do you really use the sort method in JavaScript

    Time:2019-11-27

    In normal business development,ArrayIt’s a data type we often use, so it’s also common to sort arrays. Instead of using the method of looping through arrays to arrange data, we use the native method in JS arrayssortTo arrange (yes, more advocating the original power of JS). How to judge whether an object is an array […]

  • C. sorting cases

    Time:2019-11-26

    using System; Namespace sorting cases { class Program { static void Main(string[] args) { //Define random sequence int a, b, c, d; Random rand = new Random(); int[] intArray = new int[10]; for (int i = 0; i < intArray.Length; i++) { a = rand.Next(1, 100); intArray[i] = a; } foreach (int item in intArray) […]

  • Javascript: algorithmic thinking and code implementation of top ten sorting

    Time:2019-11-22

    This paper includes: (two-way) bubble sort, selection sort, insertion sort, fast sort (pit filling and exchange), merge sort, bucket sort, cardinality sort, count sort (optimization), heap sort and Hill sort. You can test the code here. MoreleetcodeOfJavaScriptThe solution can also be found in my algorithm warehouse. Welcome to check~ In addition, the top ten C […]

  • C-bubble sort

    Time:2019-11-17

    I. definition Bubble sorting: to sort the elements of an array from large to small or from small to large. Note: bubble sorting test array and for understanding, mainly for interview; Two. Analysis. int[] nums={9,8,7,6,5,4,3,2,1,0}; 0 1 2 3 4 5 6 7 8 9 The first comparison: 8 7 6 5 4 3 2 […]

  • C. datatable of common tools and methods (I)

    Time:2019-11-15

    1. List of datatable to generic t /// ///Dataset datatable to list collection /// /// /// /// public static List ToListByDataTable(DataTable dtTemp) { if (dtTemp == null || dtTemp.Rows.Count == 0) { return null; } List lstResult = new List(); for (int j = 0, l = dtTemp.Rows.Count; j < l; j++) { T _t […]

  • leetcode451. Sort Characters By Frequency

    Time:2019-11-14

    Subject requirements Given a string, sort it in decreasing order based on the frequency of characters. Example 1: Input: “tree” Output: “eert” Explanation: ‘e’ appears twice while ‘r’ and ‘t’ both appear once. So ‘e’ must appear before both ‘r’ and ‘t’. Therefore “eetr” is also a valid answer. Example 2: Input: “cccaaa” Output: “cccaaa” […]

  • Merge sort

    Time:2019-11-4

    /**Algorithm idea:The input sequence of length n is divided into two subsequences of length n / 2;The two subsequences are sorted by merging;Merge two sorted subsequences into a final sorting sequence.Time complexity of O (n log n). The cost is extra memory. */ /**Merge sort — combine two sorted arrays into a sort array @param […]