Puzzle: Sort an array of 0's and 1's in one parse.

后端 未结 6 793
情歌与酒
情歌与酒 2020-12-31 16:00

Is it possible to arrange the array made up of only 1\'s and 0\'s in descending order within one parse without using auxiliary array?
For example: Suppose you have an ar

6条回答
  •  無奈伤痛
    2020-12-31 16:41

    Just an other way of it .

    Have two pivots one from beginning and other at end like the bellow one ,

    for(int i=0, j=n-1;i

提交回复
热议问题