摘要:
Given an integer array (index from 0 to n-1, where n is the size of this array), and an query list. Each query has two integers [start, end]. For each 阅读全文
摘要:
For an array, we can build a SegmentTree for it, each node stores an extra attribute count to denote the number of elements in the the array which val 阅读全文
摘要:
For a Maximum Segment Tree, which each node has an extra value max to store the maximum value in this node's interval. Implement a modify function wit 阅读全文
摘要:
For an integer array (index from 0 to n-1, where n is the size of this array), in the corresponding SegmentTree, each node stores an extra attribute m 阅读全文
摘要:
One way to serialize a binary tree is to use pre-oder traversal. When we encounter a non-null node, we record the node's value. If it is a null node, 阅读全文
摘要:
The structure of Segment Tree is a binary tree which each node has two attributes start and end denote an segment / interval. start and end are both i 阅读全文
摘要:
Given a matrix of m x n elements (m rows, n columns), return all elements of the matrix in ZigZag-order. Have you met this question in a real intervie 阅读全文