Professional Documents
Culture Documents
Patience Sort Algo Mosab - 2802
Patience Sort Algo Mosab - 2802
INDEX.HTML
/CONTENTS OF THIS TEMPLATE
INDEX.HTML
patience sorting is a sorting algorithm inspired by, and
named after, the card game patience. A variant of the
algorithm efficiently computes the length of a
longest increasing subsequence in a given array.
INDEX.HTML
Worst case/best case
When the input data contain When the input data contain
natural decreasing sub-arrays, natural "runs", i.e., non-
then performance can be strictly decreasing sub-arrays, then
worse. performance can be strictly
better.
Worst case:
O(n log n) best case:
O(n)
Worst case/best case
Test run
Average time: 12,213 milliseconds
Amount:50,000 random numbers
Number of runs: 8
INDEX.HTML
INDEX.HTML
INDEX.HTML
INDEX.HTML
INDEX.HTML
/RESOURCES
https://en.wikipedia.org/wiki/Patience_sorting
https://www.geeksforgeeks.org/
INDEX.HTML