Random commentary about Machine Learning, BigData, Spark, Deep Learning, C++, STL, Boost, Perl, Python, Algorithms, Problem Solving and Web Search
Wednesday, July 18, 2012
Array and positions
Given an array of n distinct integers sorted in ascending order, write a function that returns true is there is an index i such that arr[i] is equal to i
return a[0] == 0
ReplyDelete// Checking only the first item is good enough.