Quick actions

cmd+k|ctrl+k

Navigation

Languages

Udemy: Master Coding Interview - Sorting Interview - #184

Snippet info

Language

Csharp

Visibility

public

Author

jcurrie33

Created

2020-08-13T10:12:05Z

Updated

2020-08-13T10:12:05Z

using System;

class MainClass {
    static void Main() {
        Console.WriteLine("Hello World!");
        
        // Which sort to use in each case???
        
        //#1 - Sort 10 schools around your house by distance:
        // insertion sort b/c there are few
        //#2 - eBay sorts listings by the current Bid amount:
        // radix or counting b/c bids ar ~ $1 to $50,000. Fixed integers
        //#3 - Sport scores on ESPN
        // quicksort b/c has better space complexity
        //#4 - Massive database (can't fit all into memory) needs to sort through past year's user data
        // mergesort
        //#5 - Almost sorted Udemy review data needs to update and add 2 new reviews
        // insertion sort b/c almost sorted
        //#6 - Temperature Records for the past 50 years in Canada
        // radix or counting if no decimals, otherwise quick sort
        //#7 - Large user name database needs to be sorted. Data is very random.
        // Merge sort if enough memory. Or Quick sort 
        //#8 - You want to teach sorting for the first time
    }   // bubble or selection sort 
}
INFO