human
Print n smallest elements from given array in their original order | Function for binary_search.
Function to print smallest n numbers.
Make copy of array.
Sort copy array.
For each arr [ i ] find whether it is a part of n - smallest with binary search.
Driver Code"
Solution in Python:

Give me a code to print n smallest elements from given array in their original order and the other steps required?
assistant
#Here is code to print n smallest elements from given array in their original order and the other steps required.
 def binary_search ( arr , low , high , ele ) :
	while low < high :
		mid = ( low + high ) // 2
		if arr [ mid ] == ele :
			return mid
		elif arr [ mid ] > ele :
			high = mid
		else :
			low = mid + 1
	return - 1
def printSmall ( arr , asize , n ) :
	copy_arr = arr . copy ( )
	copy_arr . sort ( )
	for i in range ( asize ) :
		if binary_search ( copy_arr , low = 0 , high = n , ele = arr [ i ] ) > - 1 :
			print ( arr [ i ] , end = " ▁ " )
if __name__ == " _ _ main _ _ " :
	arr = [ 1 , 5 , 8 , 9 , 6 , 7 , 3 , 4 , 2 , 0 ]
	asize = len ( arr )
	n = 5
	printSmall ( arr , asize , n )