public boolean increasingTriplet(int[] nums) {
        int T[] = new int[3];
        int len = 0;
        for (int i = 0; i < nums.length; i++) {
            boolean found = false;
            for (int j = 0; j < len; j++) {
                if (T[j] >= nums[i]) {
                    T[j] = nums[i];
                    found = true;
                    break;
                }
            }
            if (!found) {
                T[len++] = nums[i];
            }
            if (len == 3) {
                return true;
            }
        }
        return false;
    }
Date 03/06/2016
@author Tushar Roy

Find if there exists an increasing triplet subsequence.
Similar method to longest increasing subsequence in nlogn time.

Time complexity is O(n)
Space complexity is O(1)

https://leetcode.com/problems/increasing-triplet-subsequence/
src/com/interview/array/IncreasingTripletSubsequence.java