Viewing posts for the category Algorithm

## The Classic LIS Problem

# The Classic LIS Problem

Read MoreIn computer science, the longest increasing subsequence problem is to find a subsequence of a given sequence in which the subsequence's elements are in sorted order, lowest to highest, and in which the subsequence is as long as possible. This subsequence is not necessarily contiguous, or unique. wiki

## Three Reverse

# Three Reverse

**Three reverse** is a trick when you want to rotate an array.
For example, the original array is `[1,2,3,4,5]`

, rotate this array by k=2 will become `[4,5,1,2,3]`

.
This problem can be abstracted as: given an array of length `n`

, rotate this array by `k`

.