Quicksort Algorithm — Lomuto vs Hoare, With Code in C, C++, Java, Python and C#
On 5,000 sorted values a last-element pivot makes 12.5 million comparisons instead of 67,000. Quicksort, measured — with code in five languages.
Computer science is the intellectual foundation beneath every line of code you write. While programming teaches you how to instruct a computer, computer science teaches you why certain approaches work better than others — why one algorithm processes a million records in seconds while another takes hours, why the right data structure makes the difference between elegant and unworkable code, and why the principles of object-oriented design produce software that survives contact with the real world.
MYCPLUS has been publishing computer science tutorials and practical programming guides since 2004, building a comprehensive resource covering the core theoretical and applied topics that every serious programmer needs to understand. This Computer Science hub brings together four interconnected areas of study — Algorithms, Data Structures, Object-Oriented Programming and Programming Styles — each with its own dedicated section of in-depth tutorials, practical examples and working source code.
Tis section gives you the theoretical understanding and hands-on programming experience to write better software, solve harder problems and think more clearly about how programs work. Whether you are studying for exams, preparing for technical interviews or simply becoming a stronger programmer — start here.
Explore the four core areas covered in this section:
→ Algorithms — sorting, searching, graph traversal and optimisation
→ Data Structures — arrays, linked lists, trees, stacks and graphs
→ Object-Oriented Programming — classes, inheritance and polymorphism
→ Programming Styles — procedural, functional and declarative paradigms
Why MYCPLUS: Trusted by programmers and computer science students since 2004 — MYCPLUS covers all four core computer science disciplines in one place, with practical implementations in C, C++ and Java designed for both academic study and real-world software development.
On 5,000 sorted values a last-element pivot makes 12.5 million comparisons instead of 67,000. Quicksort, measured — with code in five languages.
At n = 1,000,000, O(log n) takes 20 steps and O(n squared) takes a trillion. The ten families that matter, with complexity for each.
Prefix lookups that scale with the prefix, not the dictionary — and the memory bill that pays for them, measured on 76,226 words.
Four ways to compute Fibonacci numbers in C and C++, with measured call counts and the exact term at which each integer type stops being correct.
Kruskal’s algorithm builds a minimum spanning tree by sorting edges and rejecting cycles with union-find. Tested C, C++, and Python code included.
Shell Sort improves insertion sort by sorting far-apart elements first. See how it works, why gap sequences matter, and tested code in five languages.
A linked list in C chains heap-allocated nodes through pointers. Build one completely: all operations, complexity analysis and a tested full program.
Binary Decision Diagrams compress Boolean functions into compact graphs used in verification and circuit design. This guide covers reduction rules, ROBDDs, a C example, and applications.
Polymorphism lets a single method call take many forms. This practical guide explains compile-time vs runtime polymorphism and walks through runnable C++, Java, and Python examples you can try right away.
Coding competitions are the fastest way to sharpen your problem-solving skills. Here are the best competitive programming platforms and contests to enter in 2026, for every level.
In a lot of programs my gensort-utility turned out to be very useful. It consists simply of the header file
The big sort routine implements a way to sort huge amounts of data using C programming language. It sorts the data that do not fit into main memory by using a multi-phase sorting on files. It is a implementation from the book “Algorithms and data structures” by Niklaus Wirth. Additionally, this routine recognizes small amounts of data that do fit into memory and resorts to a in-place quicksort.