Category: algorithms
Segment Tree is one of the most important data structure in Computer Science. Similar to Binary Index Tree, a Segment Tree allows us to update and query (range) in …
Given strings s0, s1 and a positive integer n, return the nth term of the sequence A where: A = s0 A = s1 A = A + A …
Introduction to Binary Index Tree or Fenwick Tree Binary Index Tree (BIT) aka Fenwick Tree is a simple data structure that has O(LogN) complexity in updating element in a …
Given a two-dimensional integer matrix, return the total number of integers whose value is the largest in its row and in its column. For example, given 1 3 2 …
You are given a tree root and a list of strings moves consisting of “RIGHT”, “LEFT” and “UP”. Starting from root, traverse the tree by performing each move in …