It consists of preprocessing an array to create a new one where each element is the sum of all elements before it.
- It can be used to get the sum of a seb array in constant time
- It can be used to get efficient cummulative sum queries
- Examples:
It is essentially a search. You can use backtracking to solve problems where you have to generate all possible solutions to something. You have a validation for the solution, and you use recursion to generate a solution, test if it is valid, save it, and backtrack to generae a new solution.
It consists of using a window to traverse the array and keep track of the sum of the elements in the window.
It consists of using two pointers to traverse the array and keep track of the sum of the elements in the window.
It consists of using a binary search to find the index of the element in the array.