




Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!





A scannable, exam-ready reference: Big-O tables, core data structures, and the five algorithmic patterns that solve most coding problems โ with clean, commented Python. Big-O Tables Code Templates Pattern Recognition Bit Tricks
Edition 01 ยท 7 pages ยท Python
contents.md
What's Inside
01 Big-O Complexity Summary Access, search, insert, delete & space โ for every core structure and sort. 02 Data Structures Essentials Linked lists, binary trees & BSTs, graphs โ definitions, traversals, code. 03 Algorithmic Patterns Two Pointers, Sliding Window, Binary Search โ ready-to-reuse templates. 04 Bit Manipulation Tricks Even/odd checks, power-of-2, XOR cancellation โ the classic one-liners. 05 Pattern Recognition Speed-Run "If you see X, think Y" โ a lookup table for the exam room.
contents.md 01_big_o.md 02_structures.py
Data Structures Essentials
## Linked List (Singly)
linked_list.py class ListNode: def init(self, val= 0 , next= None ): self.val = val # node's data self.next = next # pointer to next node ## Binary Tree & BST
Traversal Order Use Case
tree_node.py class TreeNode: def init(self, val= 0 , left= None , right= None ): self.val = val self.left = left self.right = right ## Graphs Representation Space Edge Lookup Best For
02_structures.py 03_patterns.py
Algorithmic Patterns
## Two Pointers
two_pointers.py def two_pointer_template(arr, target): left, right = 0 , len(arr) - 1 while left < right: current_sum = arr[left] + arr[right] if current_sum == target: return [left, right] elif current_sum < target: left += 1 # need bigger sum else : right -= 1 # need smaller sum return [- 1 , - 1 ] ## Sliding Window
sliding_window.py def sliding_window_template(arr): left = 0 max_len = 0 window_state = {} for right in range(len(arr)): # 1. expand: add arr[right] to window_state while window_state_invalid(): # 2. shrink while condition broken left += 1 max_len = max(max_len, right - left + 1 ) # 3. update answer return max_len
04_bitwise.py 05_speed_run.md
Pattern Recognition Speed-Run
If you seeโฆ Thinkโฆ
Good luck in there.
Study Guides & Visual Systems