Quick Sort Implementation in C

Quicksort is an efficient sorting algorithm, serving as a systematic method for placing the elements of an array in order. Developed by Tony Hoare in 1959, published in 1961, it is still a commonly used algorithm for sorting. When implemented well, it can be about two or three times faster than its main competitors, merge sort and heapsort. Quicksort is a comparison sort, meaning that it can sort items of […]

Sort a Scrambled Itinerary

This algorithm problem is from Google Code Jam. Here is the description of the problem. Once upon a day, Mary bought a one-way ticket from somewhere to somewhere with some flight transfers. For example: SFO->DFW DFW->JFK JFK->MIA MIA->ORD. Obviously, transfer flights at a city twice or more doesn’t make any sense. So Mary will not do that. Unfortunately, after she received the tickets, she messed up the tickets and she […]