Nice explanation for #Bubble_Sort, sometimes referred to as sinking sort, is a simple sorting algorithm that repeatedly steps through the list to be sorted, compares each pair of adjacent items and swaps them if they are in the wrong order. The pass through the list is repeated until no swaps are needed, which indicates that the list is sorted.
https://youtu.be/Yaj07QdVTp8
As fragile as a soap bubble seems, these films have remarkable powers of self-healing. The animation above shows a falling water droplet passing through a soap film without bursting it. An important factor here is that the water droplet is wet–passing a dry object through a soap film is a quick way to burst it, as those who have played with bubbles know. The droplet’s inertia deforms the soap film, creating a cavity. If the drop’s momentum were smaller, the film could actually bounce the droplet back like a trampoline, but here the droplet wins out. The film breaks enough to let the drop through, but its cavity quickly pinches off and the film heals thanks to the stabilizing effect of its soapy surfactants. (Image credit: H. Kim, source)
50.1% of the US population lives in these 244 counties.
More similar maps >>
Mercator projection with a different centerpoint.
How I feel when I write anything in C++
# ‘tis but a scratch | Python
The Quicksort Algorithm
Quicksort is the fastest known comparison-based sorting algorithm (on average, and for a large number of elements), requiring O(n log(n)) steps. By convention, n is the number of elements to be compared and big O is a function of those elements. Quicksort is a recursive algorithm which first partitions an array according to several rules:
Pick an element, called a pivot, from the array.
Reorder the array so that all elements with values less than the pivot come before the pivot, while all elements with values greater than the pivot come after it (equal values can go either way). After this partitioning, the pivot is in its final position. This is called the partition operation.
Recursively apply the above steps to the sub-array of elements with smaller values and separately to the sub-array of elements with greater values.
Quicksort was invented by Tony Hoare and has undergone extensive analysis and scrutiny, and is known to be about twice as fast as the next fastest sorting algorithm. In the worst case, however, quicksort is a slow n² algorithm (and for quicksort, “worst case” corresponds to already sorted). (Click this link for an example of the Quicksort Algorithm written in C)
Credit: Wolfram Alpha/Wikipedia
pew pew pew
Machine Learning, Big Data, Code, R, Python, Arduino, Electronics, robotics, Zen, Native spirituality and few other matters.
107 posts