Concepts5
βοΈAlgorithmIntermediate
Complexity Analysis Quick Reference
Use an operation budget of about 10^8 simple operations per second on typical online judges; always multiply by the time limit and number of test files if known.
#time complexity#competitive programming#big-o+12
βοΈAlgorithmIntermediate
Fast I/O and Optimization Tricks
Fast I/O reduces overhead from C and C++ stream synchronization and avoids unnecessary flushes, which can cut runtime by multiples on large inputs.
#fast io#iostream synchronization#cin.tie+12
βοΈAlgorithmIntermediate
Small-to-Large Principle
Small-to-large means always merge the smaller container into the larger one to keep total work low.
#small-to-large#sack technique#dsu on tree+11
βοΈAlgorithmIntermediate
Small-to-Large Merging
Small-to-large merging is a technique where you always merge the smaller container into the larger one to guarantee low total work.
#small-to-large merging#dsu on tree#sack technique+11
ποΈData StructureIntermediate
Hash Table
A hash table stores keyβvalue pairs and finds items in expected O(1) time using a hash function to map keys to buckets.
#hash table#unordered_map#unordered_set+12