human
Program to print an array in Pendulum Arrangement | Prints pendulam arrangement of arr [ ].
sorting the elements.
Auxiliary array to store output.
calculating the middle index.
storing the minimum element in the middle i is index for output array and j is for input array ..
adjustment for when no . of elements is even.
Printing the pendulum arrangement.
input Array.
calling pendulum function"
Solution in Python:

=====
Give me a code to program to print an array in Pendulum Arrangement and the other steps required?
assistant
#Here is code to program to print an array in Pendulum Arrangement and the other steps required.
 def pendulumArrangement ( arr , n ) :
	arr . sort ( )
	op = [ 0 ] * n
	mid = int ( ( n - 1 ) / 2 )
	j = 1
	i = 1
	op [ mid ] = arr [ 0 ]
	for i in range ( 1 , mid + 1 ) :
		op [ mid + i ] = arr [ j ]
		j += 1
		op [ mid - i ] = arr [ j ]
		j += 1
	if ( int ( n % 2 ) == 0 ) :
		op [ mid + i ] = arr [ j ]
	print ( " Pendulum ▁ arrangement : " )
	for i in range ( 0 , n ) :
		print ( op [ i ] , end = " ▁ " )
arr = [ 14 , 6 , 19 , 21 , 12 ]
n = len ( arr )
pendulumArrangement ( arr , n )