Tag: Data Structure
10 posts
-
How Go Slices Really Work: Header Layout, append Growth, Shared Backing Arrays and Pitfalls
Go slice internal structure, memory allocation mechanism, capacity vs length, append operation principles, performance optimization techniques.
-
Data Structures for Beginners: Arrays, Lists, Stacks, Queues, Trees and Graphs Compared
An introduction to data structures: arrays, linked lists, stacks, queues, trees and graphs, their time complexities, and how to pick one for a real problem.
-
Implementing Data Structures in C++: Linked List, BST, and Hash Table, and the Bugs Each One Hides
Implementing a linked list, binary search tree, and open-addressing hash table in C++ from scratch, with the problems textbook versions skip: copy semantics and double deletes, recursion depth on sorted input, deletion in linear probing, and cache behavior.
-
C++ struct vs class: The One Language Difference and the Conventions Built on It
struct and class differ only in default member and base-class access. What that means for inheritance, POD and aggregates, and when to pick which keyword.
-
How to Prepare for Coding Tests: Core Patterns, Data Structures and Time Management
How to prepare for coding tests: which algorithms and data structures to learn first, spotting problem patterns, pacing a two-hour exam, and Python vs C++.
-
Hash Tables and Python dict: Hash Functions, Collisions and Why O(1) Is Only Average
Hash tables for coding interviews: how hash functions and collision resolution work, using Python dict and collections effectively, and the mistakes that turn O(1) lookups slow.
-
Binary Trees and BSTs: Traversals, Recursion Depth, Validation and Serialization
Binary trees for interviews: why the BST property covers whole subtrees, skewed trees and RecursionError, iterative traversals, level order, and serialization.
-
Graph Representation: Adjacency List vs Matrix, Building Graphs from Input, and Cycle Detection
Graph representation for interviews: adjacency list vs matrix memory, grids and edge lists, index bugs in graph building, cycle detection, topological sort.
-
Arrays vs Linked Lists for Coding Interviews: Access Costs, Two Pointers and Common Traps
Arrays and linked lists for coding interviews: how their time complexities differ, the two-pointer and prefix-sum techniques that show up most, and practice problems by difficulty.
-
Stacks and Queues in Interviews: LIFO/FIFO Patterns, Monotonic Stacks and Deques
Stacks and queues for coding interviews: LIFO and FIFO behavior, the problem patterns they solve (bracket matching, BFS, monotonic stacks), and the mistakes that cost points.