Tag: algorithms
All the articles with the tag "algorithms".
-
Heap Sort in C++: How It Works, With Full Code and Complexity
Learn heap sort in C++ with a complete working program. Understand what a max heap is, how heapify works, and why heap sort is always O(n log n) time.
-
Linear Search in C++: How It Works, With Code and Complexity
Learn linear search in C++ with full working code. Search arrays and vectors step by step, handle not-found cases, and see how it compares to binary search.
-
Quick Sort in C++: How It Works, With Full Code and Complexity
Learn quick sort in C++ with a complete working program. Understand the pivot, the partition step, recursion, and why quicksort usually beats merge sort.
-
Binary Search in C++: Iterative, Recursive, and std::binary_search
Learn binary search in C++ step by step. Write the iterative and recursive versions, avoid the classic off-by-one bugs, and use std::binary_search correctly.