srbcheema1 / Algo_Ds

Repository for cool algorithms and Datastructures
183 stars 307 forks source link

Create IncreasingTriplletSubsequence.cpp #236

Open suchismith opened 5 years ago

suchismith commented 5 years ago

Given an unsorted array return whether an increasing subsequence of length 3 exists or not in the array.

Formally the function should:

Return true if there exists i, j, k
such that arr[i] < arr[j] < arr[k] given 0 ≤ i < j < k ≤ n-1 else return false.