## Longest positive subarray

Array A[] contains only ‘1’ and ‘-1’

Construct array B, where B[i] is the length of the longest continuous subsequence starting at j and ending at i, where j < i and A[j] + .. + A[i] > 0

## Check If there exists a Circle

We are given a string consisting of letters- F,L,R. – which is the instruction a robot follows

F- goes forward by one step.

L-turn left.

R- turn right.

## Modeling a graph in Python

I’m trying to solve a problem related to graphs in Python. Since its a comeptitive programming problem, I’m not using any other 3rd party packages.

The problem presents a graph in the form of a 5 X …

## How do you implement the factorial function in C++?

Possible Duplicates:
Calculating large factorials in C++
Howto compute the factorial of x
How do you implement the factorial function in C++? And by this I mean properly implement it using …

## Is it correct to ask to solve an NP-complete problem on a job interview?

Today there was a question on SO, where the author was given an NP-complete problem during an interview and he obviously hadn’t been told that it was one.

What is the purpose of asking such questions?…

## What is the real name of median sort and/or where can I find more material on it

I’m reading the book Algorithms in a Nutshell published by O’Reilly Media and I was reading the section on sorting algorithms and found one called Median Sort. Since I had never heard of it before and …

## Find First Unique Element

You have to find first unique element(integer) in the array.
For example:

3,2,1,4,4,5,6,6,7,3,2,3
Then unique elements are 1, 5, 7 and first …

## Calculating distance between zip codes in PHP

I grabbed a database of the zip codes and their langitudes/latitudes, etc from this