Cheatsheet: Difference between revisions
→Redirect Stderr
(→Python) |
|||
(2 intermediate revisions by the same user not shown) | |||
Line 949:
ls > file.log 2>&1 OR ls &> file.log
ls > file.log 2> /dev/null
=== System Calls ===
{{UC}}
= Sorting Algorithms =
It is a good default choice.
It tends to be fast in
* Heapsort
The Linux kernel uses heapsort instead of quicksort for both of those reasons.▼
where the bottleneck cost is reading and writing the input on disk, not comparing and swapping individual items.▼
* Merge sort
'''Radix sort''' looks fast, with its O(n)O(n)O(n) worst-case time complexity. ▼
It is a good choice if you want a stable sorting algorithm.
if you're using it to sort binary numbers, then there's a hidden constant factor that's usually 32 or 64 (depending on how many bits your numbers are).▼
▲ It can easily be extended to handle data sets that can't fit in
That's often way bigger than O(lg(n))O(\lg(n))O(lg(n)), meaning radix sort tends to be slow in practice.▼
'''Counting sort''' is a good choice in scenarios where there are small number of distinct values to be sorted. ▼
* Radix sort
This is pretty rare in practice, and counting sort doesn't get much use.▼
▲
▲
* Counting sort
▲
* Which sorting algorithm has best asymptotic run time complexity?
Line 1,027 ⟶ 1,036:
RSET (Reset)
SMTP errors:
4.X.X Persistent Transient Failure
5.X.X Permanent Error:
|