print each iteration binary search c++ [closed]

  algorithm, binary, c++, search, sorting

I want to implement binary search on my program but I also want to print the array step by step for each iteration

e.g:

Iteration 1: [9, 20, 11, 23, 4]
Iteration 2: [11, 23, 4]
Iteration 3: [23]

anyone has any idea how to do it? Much appreciated!

Source: Windows Questions C++

LEAVE A COMMENT