Udemy: Master Coding Interview - Sorting Interview - #184

Run Settings
LanguageC#
Language Version
Run Command
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 }
Editor Settings
Theme
Key bindings
Full width
Lines