Tag: algorithms
All the articles with the tag "algorithms".
-
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.
-
Selection Sort in C++: How It Works, With Code and Complexity
Learn selection sort in C++ with a full working program. See how the algorithm picks the smallest element each pass, plus its time complexity and trade-offs.
-
Find the Maximum and Minimum in C++ (max, min, max_element)
Find the maximum and minimum in C++. Use std::max and std::min for two numbers, and std::max_element to find the largest value in a whole array or vector.