C++ Time Complexity Cheat Sheet PDF
The C++ Time Complexity Cheat Sheet serves as a quick reference for beginners and intermediates looking to learn C++ data structures. This is a 1-page PDF in A4 paper size which can be printed at home.
Did you know that pushing an element on a stack in C++ takes O(1) but only if the stack adapts a deque? If the stack adapts a vector then pushing an element takes Θ(1); the big Theta symbol, Θ, represents amortized/average time complexity. Details such as these matter during tech screens and interviews, and we sincerely hope that this quick reference guide will help you stand out and win that dream job.
Data Structures:
- Array (std::array)
- Vector (std::vector)
- Deque (std::deque)
- Singly Linked List (std::forward_list)
- Doubly Linked List (std::list)
- Ordered Set (std::set)
- Ordered Map (std::map)
- Ordered Multiset (std::multiset)
- Ordered Multimap (std::multimap)
- Unordered Set (std::unordered_set)
- Unordered Map (std::unordered_map)
- Unordered Multiset (std::unordered_multiset)
- Unordered Multimap (std::unordered_multimap)
- Stack (std::stack)
- Queue (std::queue)
- Priority Queue (std::priority_queue)
Functions:
- operator[]
- at
- front
- back
- top
- begin
- end
- rbegin
- rend
- empty
- size
- max_size
- clear
- insert
- erase
- push_back
- pop_back
- push_front
- pop_front
- push
- pop
- splice
- find
Bonus!
Algorithm Library Functions:
- sort
- stable_sort
- partial_sort
- nth_element
- partition
- stable_partition
- lower_bound
- upper_bound
- binary_seach
GCC Builtin Functions:
- __builtin_clz
- __builtin_ctz
- __builtin_popcount
Are you looking for a cheat sheet for JavaScript, Python, Java, C#, PHP, Ruby or another programming language? If so, please feel free to drop us a line at info@jobsort.com and we'll be more than happy to create one for your programming language of choice.
You'll get a high-quality LaTeX-based PDF which you can use indefinitely as a quick reference to double-check time complexities during tech screens and interviews.