Tag: set
5 posts
-
std::set_union, set_intersection and set_difference on Sorted Ranges: Duplicates, Comparators and Silent Wrong Output
How the STL set algorithms merge two sorted ranges in one pass, how they treat duplicates, and why unsorted input or a mismatched comparator fails silently.
-
Python list vs tuple vs set: Mutability, Duplicates, Big-O and Memory
Compare Python list, tuple, and set: ordering, duplicates, big-O operations, memory, and a decision flowchart for real code.
-
Python Data Types Explained: Mutability, Aliasing, Float Rounding, is vs == and Truthiness
How Python data types really behave: names vs objects, list aliasing and copies, int vs float precision, round() and Decimal, str immutability, dicts, is vs ==.
-
Python Comprehensions and Generator Expressions: Scope, Late Binding, Laziness and Memory
How Python comprehensions really behave: clause order, Python 3 scoping and the class-body trap, late-binding lambdas, one-shot generators, walrus, and memory.
-
set vs unordered_set in C++: Performance, Custom Comparators and Hashes, and Set Operations
set·unordered_set performance comparison, multiset, custom comparator·hash, practical set operations, iterator invalidation guide.