
LeetCode: The 'Kth Smallest Element in a BST' Problem
How to solve Kth Smallest Element in a BST by leaning on in‑order traversal instead of extra sorting the tree already makes unnecessary in interviews.
Articles
Data structures are the shapes we choose to organise information so the surrounding code can work with it efficiently. Tries, heaps, stacks, queues, linked lists, trees, hash maps, caches, and disjoint sets all solve different access and update problems, which is why they overlap so naturally with both Algorithms and LeetCode. This category is for the posts where the structure itself is a big part of the lesson, not just a background detail in the final solution.
Below you will find a subset of articles from my blog specifically about Data Structures. This is an area that I have worked with for many years, and have managed to write about quite a few times. There are eleven collected together for you below.

How to solve Kth Smallest Element in a BST by leaning on in‑order traversal instead of extra sorting the tree already makes unnecessary in interviews.

The diameter of a binary tree is the longest path between any two nodes. I'll explain clearly how we can solve this problem using recursion in JavaScript.

The 'Merge Two Sorted Lists' problem on LeetCode involves combining two sorted linked lists into one. Here, I explore a clear solution with TypeScript examples.

Solve Daily Temperatures with a monotonic stack in TypeScript, storing indices to find the next warmer day without repeated scanning and common mistakes.

Implement a Trie prefix tree in TypeScript with Map‑based nodes, insert, search, startsWith, shared prefixes, complexity, and alternative child storage.

Solve Binary Tree Zigzag Level Order Traversal with breadth‑first search, level sizing, alternating output order, and TypeScript implementation details.

Solve Binary Tree Level Order Traversal with breadth‑first search in TypeScript, using a queue, level sizing, edge cases, and cleaner iteration well.

Solve Subarray Sum Equals K with prefix sums and a hash map in TypeScript, including negative numbers, count storage, and why sliding window fails.

Solve Linked List Cycle with fast and slow pointers in TypeScript, comparing visited‑node storage with Floyd's cycle detection and common mistakes.

nth Node from the End of a ListHow to remove the Nth node from the end of a linked list in TypeScript. Here we break down and explore a simple double‑pass and an efficient single‑pass method.

Explore LeetCode's 'Add Two Numbers' problem: adding numbers represented as linked lists. Dive into the challenge, TypeScript solution, and its significance.