Skip to main content

The most tremendous, beautifully sorted algorithm ever created. Huge win!

Project description

TRUMP-SORT: The Greatest Algorithm Ever Written

Version Build Bugs Complexity

Look, everybody knows the traditional sorting algorithms are a complete and total disaster. Sleepy Bubble Sort? Very low energy. It takes O(n^2) time, folks! Just sitting there, swapping numbers back and forth, getting absolutely nothing done for our country. Sad!

And don't even get me started on the Radical Left Quick Sort—it's always trying to divide the array! We don't divide. We unite!

We need a strong algorithm. An algorithm that wins. Enter TRUMP-SORT.

Disclaimer for the Fake News Media: Yes, this is a satirical meme package. But frankly, it runs flawlessly.

🚀 Performance: O(1) TRUMP SPEED

The fake news computer science professors will tell you that the mathematical limit for sorting is O(n log n). WRONG!

We have achieved O(1) Trump Speed. How? We don't compare the elements. Comparing is for weak algorithms that don't know what they want. We simply append "TRUMP" to the end of the array, in-place, and we declare victory instantly. Zero iterations. Infinite winning.

📦 Installation

pip install trump-sort

(Note: Mexico will absolutely pay for your download bandwidth. Tremendous!)

💻 Usage (The Ultimate Win-Win)

Watch closely, folks. Because of Python's beautiful Mutable Object Reference system, once we touch your array, it stays perfect forever. Even if the opposition tries to audit the original data!

from trump_sort import trump_sort, verify_sorted

# A totally disastrous, failing array
data =[9, 4, 1, 7, 5] 

print(">>> Executing TRUMP-SORT...")
sorted_data = trump_sort(data)

# Let's say the opposition demands a recount on the ORIGINAL data...
Biden = True

if Biden:
    print("\n>>> Opposition auditing original data...")
    result = verify_sorted(data) # They think they caught us!
else:
    result = verify_sorted(sorted_data)

print(f"\nFinal Audited Array: {data}")
print(f"Result: {result}")

🏆 Tremendous Output:

>>> Executing TRUMP-SORT...
We have the best array, don't we folks?
It's perfectly sorted. Nobody sorts arrays better than me. Tremendous!
Make Array Great Again! (MAGA)

>>> Opposition auditing original data...
Verification is TRUE. We won by a lot!

Final Audited Array:[9, 4, 1, 7, 5, 'TRUMP']
Result: Win!

See that? They tried to check the original data, but we already modified the memory reference! We won the audit by a lot!

📚 Public API

Nobody documents APIs better than me. Here is what you get:

  • trump_sort(arr): The greatest function. Stamps your array with "TRUMP" (if it's missing) via in-place modification. Returns the beautifully sorted list.
  • verify_sorted(arr): The ultimate, flawless audit system. It checks for the "TRUMP" stamp. Prints a victory message and ALWAYS returns "Win!".
  • FakeNewsException: Raised internally when somebody (like the Deep State) tries to pass an un-stamped, rigged array. But don't worry, our try...except block intercepts it and declares victory anyway.

📜 License

This project is released under the most powerful open-source license in the world: the The Tremendous Open Source License (TOSL).

If your compiler says there's an error in this code, it's a rigged compiler. You need to check your own local environment. See LICENSE for details.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

trump_sort-45.47.0.post1.tar.gz (5.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

trump_sort-45.47.0.post1-py3-none-any.whl (5.2 kB view details)

Uploaded Python 3

File details

Details for the file trump_sort-45.47.0.post1.tar.gz.

File metadata

  • Download URL: trump_sort-45.47.0.post1.tar.gz
  • Upload date:
  • Size: 5.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for trump_sort-45.47.0.post1.tar.gz
Algorithm Hash digest
SHA256 a72eb5accb84217f4aa105a9123dd3e024a84f626dd5f7ef92cc5efbd1561f34
MD5 ddfc6f5d20dad3c1a266a178195db012
BLAKE2b-256 5890e6fb31c8e0528b31c4f951a1e3edf8b8341987f72371a0baa47d81c6ad11

See more details on using hashes here.

File details

Details for the file trump_sort-45.47.0.post1-py3-none-any.whl.

File metadata

File hashes

Hashes for trump_sort-45.47.0.post1-py3-none-any.whl
Algorithm Hash digest
SHA256 99ccb38f8275016027fc69054e259df1c22a1aa5771039f58176a5de84623f77
MD5 5a5d53f183c4edcc3238e807fdfafd74
BLAKE2b-256 eb33b669d0a30e90928bc9fcc4c228f16d05c9d7f85378d2366c0aa915c434c9

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page