human
Give me a code to front and Back Search in unsorted array and the other steps required given the following:
Front and Back Search in unsorted array | Python program to implement front and back search.
Start searching from both ends.
Keep searching while two indexes do not cross ..
Driver code"
Solution in Python:
assistant
#Here is code to front and Back Search in unsorted array and the other steps required.
 def search ( arr , n , x ) :
	front = 0 ; back = n - 1
	while ( front <= back ) :
		if ( arr [ front ] == x or arr [ back ] == x ) :
			return True
		front += 1
		back -= 1
	return False
arr = [ 10 , 20 , 80 , 30 , 60 , 50 , 110 , 100 , 130 , 170 ]
x = 130
n = len ( arr )
if ( search ( arr , n , x ) ) :
	print ( " Yes " )
else :
	print ( " No " )