Problem Statement:
Given the array representation of Complete Binary Tree i.e, if index i is the parent, index 2*i + 1
is the left child and index 2*i + 2 is the right child. The task is to find the minimum number of
swap required to convert it into Binary Search Tree.
Input:
arr[] = {5, 6, 7, 8, 9, 10, 11}
Output:
Output: 3
Swap 1: Swap node 8 with node 5.
Swap 2: Swap node 9 with node 10.
Swap 3: Swap node 10 with node 7.
So, Minimum 3 Swaps are required