Category: Algorithm

Find the largest connected area.

Find the largest connected area.

This is an interview question. Not hard at all, but can test something out from the interviewee.
The question is:
Give a n*m array, which only have two type of elements within it. Blank and asterisk (*):
Let you to find out the largest connected asterisk (*) area. Note that only the orthogonal elements (share an adjacent border) can be treated as connected.

Maximum sub sequence

Maximum sub sequence

Several days ago, someone (aka. cat) asked me a small algorithm  quiz which took from an interview session of her friends. The quiz is as following: ———————————————————————————————————— Given a integer sequence, find the maximum sum sub sequence of it. For instance: -1, 2, -1, 2, -1, 2, -1, 2, –1. —– It’s 5. (Which is [...]