Category: algorithms
Given a binary search tree root, and k return the kth (0-indexed) smallest value in root. It is guaranteed that the tree has at least k + 1 nodes. …
Trie is a useful data structure allow us to search a given word or check if any words start with prefix in O(N) efficient time. The following is the …
You are given a singly linked list node containing positive integers. Return the same linked list where every node’s next points to the node val nodes ahead. If there’s …
Given a singly linked list node, and an integer target, return the same linked list with all nodes whose value is target removed. Example 1 Input node = 0 …
The Fibonacci sequence goes like this: 1, 1, 2, 3, 5, 8, 13, 21, 34, … The next number can be found by adding up the two numbers before …