human
Write me a code to check if an array represents Inorder of Binary Search tree or not and the other steps required given the following:
Check if an array represents Inorder of Binary Search tree or not | Function that returns true if array is Inorder traversal of any Binary Search Tree or not ..
Array has one or no element.
Unsorted pair found.
No unsorted pair found.
Driver code"
How can the above be solved in Python?
assistant
#Here is code to check if an array represents Inorder of Binary Search tree or not and the other steps required.
 def isInorder ( arr , n ) :
	if ( n == 0 or n == 1 ) :
		return True
	for i in range ( 1 , n , 1 ) :
		if ( arr [ i - 1 ] > arr [ i ] ) :
			return False
	return True
if __name__ == ' _ _ main _ _ ' :
	arr = [ 19 , 23 , 25 , 30 , 45 ]
	n = len ( arr )
	if ( isInorder ( arr , n ) ) :
		print ( " Yes " )
	else :
		print ( " No " )