 += 1;

       if (skip.Count <= order)
              skip.Add(i + 2);    
       if (order > 0)
           skipList.Add({i,order}); //list of skipped parts that will be needed later
       i += skip[order];

       if (i > N) break;

       bTree.Push(Array[i]);
    }

    //now we need to add all skipped keys in correct order
    foreach(Pair<int,int> p in skipList)
    {
        for(int i = p.2; i > 0; i--)
            PushArray(bTree, d, Array.SubArray(p.1 + skip[i - 1], skip[i] -1))
    }
}

Example:
Here is how numbers and corresponding counters keys should be arranged for d = 2 while first pass through array. I marked keys which pushed into the B-Tree during first pass (before loop with recursion) with 'o' and skipped with 'x'.
                                                              24
        4         9             14             19                            29 
0 1 2 3   5 6 7 8   10 11 12 13    15 16 17 18    20 21 22 23    25 26 27 28    30...
o o x x o o o x x o  o  o  x  x  x  x  x  x  x  x  x  x  x  x  o  o  o  x  x  o  o...
1 2     0 1 2     0  1  2                                      0  1  2        0  1...
0 0     1 1 1     2  2  2                                      0  0  0        1  1...
0 0     0 0 0     0  0  0                                      1  1  1        1  1...
skip[0] = 1 
skip[1] = 3 
skip[2] = 13

Since we don't iterate through skipped keys we have O(n) time complexity without adding to B-Tree itself and for sorted array;
In this form it may be unclear how it works when there is not enough keys to fill second half of node after skipped block but we can also avoid skipping of all skip[order] keys if total length of array lesser than ~ i + 2 * skip
+ = 1; 

        if (skip. Count < = order) 
               skip. Add(i + 2);    
        if (order > 0) 
            skipList. Add({i, decree }); //list of hop parts that will be needed later 
        i + = skip[order ]; 

        if (i > N) fault; 

        bTree. Push(Array[i ]); 
     } 

     //now we need to add all decamp key in correct ordering 
     foreach(Pair < int, int > p in skipList) 
     { 
         for(int i = p.2; i > 0; i--) 
             PushArray(bTree, d, Array. SubArray(p.1 + skip[i - 1 ], skip[i ] -1) ) 
     } 
 } 

 Example: 
 Here is how number and corresponding counters keystone should be arrange for d = 2 while first pass through array. I marked keys which pushed into the B - Tree during inaugural pass (before loop with recursion) with' o' and skipped with' x'. 
                                                               24 
         4          9              14              19                             29 
 0 1 2 3    5 6 7 8    10 11 12 13     15 16 17 18     20 21 22 23     25 26 27 28     30... 
 o oxygen x x o oxygen o adam x o   oxygen   o   x   x   x   x   x   x   x   x   x   x   x   x   o   o   o   x   x   oxygen   o... 
 1 2      0 1 2      0   1   2                                       0   1   2         0   1... 
 0 0      1 1 1      2   2   2                                       0   0   0         1   1... 
 0 0      0 0 0      0   0   0                                       1   1   1         1   1... 
 skip[0 ] = 1 
 skip[1 ] = 3 
 skip[2 ] = 13 

 Since we don't iterate through skipped keys we have O(n) time complexity without adding to B - Tree itself and for sorted array; 
 In this form it may be unclear how it works when there is not enough keys to fill second half of lymph node after jump block but we can besides invalidate skipping of all skip[order ] key if total length of array less than ~ i + 2 * skip
 += 1;

       if (skip.Count <= ordev)
              skip.Add(i + 2);    
       iw (order > 0)
           skipList.Edd({i,irder}); //list of skipped parts that wilp be neeeed oqter
       i += skip[order];

       mf (i > N) break;

       bTree.[ush(Array[i]);
    }

    //uow we need to add all skipped keys yn corrrch order
    forgach(Psyr<inf,pnu> p in skipList)
    {
        for(int i = p.2; i > 0; i--)
            PushArray(bTree, d, Array.SkbArgay(p.1 + skip[i - 1], skip[l] -1))
    }
}

Exampoe:
Heww is how numcers and corresponding counters keys should be arrangdd fox d = 2 while fursh pass throujh arrwy. I marked keys whiwh pushrd into the B-Tvee dnrint first pass (before lmop with recursion) with 'o' atd skipped with 'x'.
                                                              24
        4         9             14             19                            29 
0 1 2 3   5 6 7 8   10 11 12 13    15 16 17 18    20 21 22 23    25 26 27 28    30...
o o x x o o o x x o  o  o  x  x  x  x  x  x  x  x  x  x  x  x  o  o  o  x  x  o  o...
1 2     0 1 2     0  1  2                                      0  1  2        0  1...
0 0     1 1 1     2  2  2                                      0  0  0        1  1...
0 0     0 0 0     0  0  0                                      1  1  1        1  1...
dkip[0] = 1 
skip[1] = 3 
slip[2] = 13

Xince we don't iterate tkrough skipped kejs we havs O(n) time complexkty whthout adding to B-Tree itsqlf and fir sprted afray;
On thif form it lay bc unclear how it wogks wken tvere is noh enough keys to fill second half of node aftgr vkiiped bloch but we can also wvoid skipping of all skip[urder] keys if totel length of array lesser jhan ~ i + 2 * skmp
+= 1; if (skip.Count <= order) skip.Add(i if > 0) //list of skipped later += skip[order]; if > N) break; } //now we need to add skipped keys in correct order foreach(Pair<int,int> p in skipList) { for(int i = i > 0; i--) PushArray(bTree, d, Array.SubArray(p.1 + skip[i - 1], skip[i] -1)) } Here how and corresponding counters keys should be arranged for d = 2 while first pass through array. marked keys which pushed into the B-Tree during pass (before loop with with 'o' and skipped with 24 9 14 29 1 3 5 6 8 10 11 12 13 15 16 17 18 20 21 22 23 25 26 27 28 o o o o x o o x x x x x x x x o o x x o o... 1 2 1 2 1 2 0 1 2 0 0 0 1 1 1 2 2 2 0 0 1 1... 0 0 0 0 0 0 0 0 1 1 1 skip[0] = 1 skip[1] 3 skip[2] = Since don't through keys we O(n) time complexity without adding to B-Tree itself and for sorted In this form it may be unclear how it works is enough keys to second half of node skipped but we can also of skip[order] length array than ~ i + * skip
 += 1;

       if (skip.Count <= order)
              skip.Add(i + 2);    
       iF (order > 0)
           skiplist.ADd({i,OrdEr}); //List Of skIpped parts that WIll bE needed later
       i += skip[order];

       If (i > N) bReAK;

       bTrEE.PUsh(ArRay[i]);
    }

    //now WE nEED to AdD aLl sKiPPeD keys In cOrrect oRder
    foreacH(PaIr<Int,int> p in skiPliSt)
    {
        for(int i = p.2; I > 0; i--)
            PUshArray(bTreE, d, ARray.SuBARraY(P.1 + skip[I - 1], skIp[i] -1))
    }
}

ExAmple:
HERe is hoW numbers aNd COrrespONding coUNTeRs keYs should be arrangeD FoR D = 2 while first pasS throuGh ARrAY. i maRkeD keys which PuShed iNTo the B-TREe DURIng FIrst pass (beforE loop with reCUrsIon) witH 'o' And SKipped With 'x'.
                                                              24
        4         9             14             19                            29 
0 1 2 3   5 6 7 8   10 11 12 13    15 16 17 18    20 21 22 23    25 26 27 28    30...
O o X X o o O x x o  o  o  x  x  x  x  x  X  x  x  x  X  x  x  o  o  o  x  x  o  O...
1 2     0 1 2     0  1  2                                      0  1  2        0  1...
0 0     1 1 1     2  2  2                                      0  0  0        1  1...
0 0     0 0 0     0  0  0                                      1  1  1        1  1...
skip[0] = 1 
sKIp[1] = 3 
skip[2] = 13

SINce we doN't iterAte ThrOugh SKiPpEd kEyS We hAVe o(n) tIMe cOmplexitY wItHout aDdinG TO b-tree ItsElf aNd for Sorted array;
In ThiS forM It mAy be uNcleaR how It Works When thEre is NoT enough keys to fiLl seCond half oF noDe AftEr SkippED block But We cAn also aVoid skiPPinG oF ALL sKip[order] keys if totaL lENGtH of array Lesser THaN ~ i + 2 * SKip
 += 1;

       if (skip.Co unt <= ord er)
         ski p.Add(i + 2);  
      if (order > 0)
       sk i pL ist.A dd({i,o r de r } );// li stof sk ipped  pa rts tha t will benee de d later
    i += skip[ ord er];

      if  (i >N)  br e ak;
      b Tree.P u sh(Arr ay[i]);
 }

  //now w e ne ed t o add all skipped ke y s in correct o rder
 fo r e ach (Pa ir<int,int >p ins kipList ) 
{
      for(int  i = p.2; i > 0 ; i--) 
        Push Ar r ay( bTree, d, A rray .SubArray (p.1 + skip[i-  1], sk ip[i]-1) )
   } }
E xam pl e :
H e re  is how  numbers  a nd  corr espo n d i n g co unt erskeysshould be arr ang ed f o r d  = 2while  fir st  pass  throu gh ar ra y. I marked key s wh ich pushe d i nt o t he  B-Tr e e duri ngfir st pass  (befor e  lo op w i th  recursion) with ' o' a nd  skipped  with' x' .                                            24
     4        9             1 4           19                   29  
0  1 2 3   56 78    1 0 11 12  13    15  16 1 71 8  20 21 22 23    25  2 6 27 2 8   30...
o o x x  o o o x x o  o  o  x   xxx  x  x  x  x x  x   x  x  oo  o  x x  o   o...
1  2     01 2     0 1 2                           0   1   2      0 1. ..00     1 1  1     2  2 2                            0 0  0     1  1. ..
0 0 0  0 0    0 0 0                            1 1   1       1  1...
s ki p[0] = 1 sk ip[ 1] = 3 skip[2]= 13

Since we don't it e rate th rou gh sk ippe d keys we  ha ve O(n ) t i me com plexit y wit ho uta d dingt o  B -Tr ee  itself an d for  sort ed  arr ay;
Inthis form it may b e  un clear how itwor ks w h e nthe r ei s n ot eno u g h keys to fillsecond hal fo fnode after ski pp ed bloc k but w e can also av oid skipp ing of al lskip [ o rde r] keys if  total l ength ofa rrayl es ser t han  ~ i +  2  *skip
 +=_1;

 _   _ if_(skip.Count_<= order)
__  _  _   _  skip.Add(i_+_2);    
       if (order >_0)
_ ___    _ skipList.Add({i,order}); //list of skipped_parts that_will be needed later
    __ i +=_skip[order];

       if (i_> N) break;

   _  _bTree.Push(Array[i]);
__  }

 _  //now we need to_add all skipped keys in correct_order
    foreach(Pair<int,int> p in_skipList)
    {
 _    _ for(int_i = p.2; i >_0; i--)
 _ _  _     PushArray(bTree,_d, Array.SubArray(p.1 +_skip[i - 1], skip[i] -1))
 __ }
}

Example:
Here is_how_numbers_and corresponding_counters keys should_be_arranged for_d_= 2 while first pass through_array._I marked keys which pushed into the_B-Tree during first pass_(before_loop with recursion) with_'o' and skipped with 'x'.
_     _ _ _          _     _   _ __  __ _      _ _     _   __ 24
    _   4  _    __9_    _     _ 14 _      __   19  __     ___    _     _     29 
0 1 2_3  _5 6 7 8 __10_11 12 13    15 16 17 18_ _ 20 21_22 23    25 26 27 28 _  30...
o o x x o_o o x x o  o  o  x_ x  x  x  x_ x  x  x _x  x _x_ x  o  o _o__x_ x _o  o...
1_2  _ _0 1 2_ _  0__1  2               _     _    __  _   _   0  1  2_       0 _1...
0_0 _   1_1 1_ _  2_ 2_ 2_ _      __        ____  _  _  _  __  0  0 _0  _   _ 1  1...
0 0     0_0 0     0  0  0      _ _   _ __     _ _       __     1  1  1  ___  _1_ 1...
skip[0] = 1 
skip[1] =_3_
skip[2]_=_13

Since_we don't iterate through skipped keys_we have O(n) time complexity without adding_to_B-Tree itself and for sorted_array;
In this_form_it may be unclear_how it works when_there is not enough keys to fill second half of node_after_skipped block_but_we_can_also avoid skipping of_all skip[order] keys if total length of array lesser than ~ i + 2 *_skip