

2.  Each bit in $T$ corresponds to at least one bit in $T_{\min}$ or $T_{\max}$. Also recall that at each step during preprocessing we append the value $\delta-1$ in unary to $T$ rather than $\delta$ (as in the representation of Fischer and Heun). Thus, we can treat each push operation (with the exception of the first and last) corresponding to a single one bit in $T$ as representing three bits: two bits in $T_{\min}$ and one bit in $T_{\max}$ or two bits in $T_{\max}$ and one bit in $T_{\min}$, depending on the corresponding value in $U$. We store a bit vector $B_{\min}$ of length $2n$ which marks the position in $T$ of the bit corresponding to the $(i \lg n
      + 1)$-th bit of $T_{\min}$, for $0 \le i \le \lfloor \frac{2n}{\lg
        n}\rfloor$. We do the analogous procedure for $T_{\max}$ and call the resulting bit vector $B_{\max}$.

Suppose now that we support the operations rank and select on $B_{\min}$, $B_{\max}$, and $T$. We use the data structure of Lemma \[lem:rrr\] that for $B_{\min}$ and $B_{\max}$ will occupy

$$O\left(\lg \binom{n}{\frac{n}{ \lg n}} + \frac{n \lg \lg n}{\lg n}\right) = O\left(\frac{n \lg \lg n}{\lg n}\right)$$

bits, and for $T$ will occupy no more than $2n + {\mathcal{O}}(\frac{n\lg\lg n
}{\lg n})$ bits. Thus, our data structures at this point occupy $3n+o(n)$ bits in total, counting the space for $U$. We will describe how to recover $\lg n$ consecutive bits of $T_{\min}$; the procedure for $T_{\max}$ is analogous. Consider the distances between two consecutive $1$ bits having indices $x_i$ and $x_{i+1}$ in $B_{\min}$. Suppose $x_{i+1} - x_{i} \le c \lg n$ in $B_{\min}$, for some constant $c \ge 9
2.   Each bit in $ T$ corresponds to at least one bit in $ T_{\min}$ or $ T_{\max}$. Also recall that at each gradation during preprocessing we add the value $ \delta-1 $ in unary to $ T$ rather than $ \delta$ (as in the representation of Fischer and Heun). therefore, we can treat each push button operation (with the exception of the first and concluding) corresponding to a single one spot in $ T$ as representing three bits: two moment in $ T_{\min}$ and one bit in $ T_{\max}$ or two bits in $ T_{\max}$ and one bit in $ T_{\min}$, depending on the corresponding value in $ U$. We store a bit vector $ B_{\min}$ of duration $ 2n$ which marks the position in $ T$ of the bit comparable to the $ (i \lg n 
       + 1)$-th bit of $ T_{\min}$, for $ 0 \le i \le \lfloor \frac{2n}{\lg 
         n}\rfloor$. We do the analogous operation for $ T_{\max}$ and call the result bit vector $ B_{\max}$. 

 Suppose now that we support the operations rate and select on $ B_{\min}$, $ B_{\max}$, and $ T$. We use the data structure of Lemma   \[lem: rrr\ ] that for $ B_{\min}$ and $ B_{\max}$ will occupy 

 $ $ O\left(\lg \binom{n}{\frac{n } { \lg n } } + \frac{n \lg \lg n}{\lg n}\right) = O\left(\frac{n \lg \lg n}{\lg n}\right)$$ 

 bits, and for $ T$ will take no more than $ 2n + { \mathcal{O}}(\frac{n\lg\lg n 
 } { \lg n})$ snatch. Thus, our data structures at this point occupy $ 3n+o(n)$ bits in total, counting the outer space for $ U$. We will describe how to recover $ \lg n$ straight moment of $ T_{\min}$; the procedure for $ T_{\max}$ is analogous. Consider the distances between two back-to-back $ 1 $ bits having indices $ x_i$ and $ x_{i+1}$ in $ B_{\min}$. Suppose $ x_{i+1 } - x_{i } \le c \lg n$ in $ B_{\min}$, for some changeless $ c \ge 9


2.  Ewch bit in $T$ corresponds to at least ong vit in $T_{\min}$ kr $T_{\max}$. Xlso recall that at each ste' dueing kgeprocessing we appena the valle $\delta-1$ un uiary to $T$ rather than $\delta$ (as ln thz cepresentation pf Fischer and Heun). Thus, wd ean treat each push operation (with tre exceltlon of the firft amq laan) gorresponding to a single one bif in $T$ es representing three bits: two bits in $T_{\mln}$ ajd one bit in $T_{\max}$ or two bitw in $R_{\max}$ and one bit in $T_{\mpu}$, depending on the corresponding value in $J$. We xtore a bij befjor $B_{\min}$ of oengtr $2n$ which mavls the positipn in $T$ of the biv coeresponding to the $(i \ng n
      + 1)$-th bit jf $T_{\min}$, fmr $0 \le i \le \lfloor \drqc{2n}{\lg
        v}\efluor$. Wx dk the wnamogous prodedure for $R_{\max}$ and call the rtsujnong bit vectkr $B_{\mav}$.

Stppose now that we support the operatiots dank and select on $B_{\min}$, $B_{\max}$, and $T$. We use thg data strtcture of Lemma \[lem:rrr\] that for $B_{\min}$ and $B_{\max}$ will occu'y

$$U\leyb(\je \blnom{n}{\frac{n}{ \lg n}} + \frac{n \lg \lg n}{\lg n}\right) = O\lefe(\rrsc{k \lg \lg n}{\lg n}\rigmt)$$

bits, and for $T$ wolp pscupy no more than $2u + {\jathcal{O}}(\frac{n\lg\lg j
}{\lg n})$ byts. Tyus, our dwta xtructures at this point ocxupy $3n+o(n)$ bitf in total, counting the space yor $U$. Ee wikl describe how to recorer $\lg n$ consecutlve bits kw $T_{\min}$; the proceaurv fos $T_{\max}$ is analogous. Considqr the diwtanees betwden jwo confecutive $1$ hits mdving indices $x_i$ ajd $x_{i+1}$ it $B_{\min}$. Supoose $x_{i+1} - x_{i} \le c \lg n$ in $B_{\min}$, for some constamt $c \ce 9
2. Each bit in $T$ corresponds to one in $T_{\min}$ $T_{\max}$. Also recall preprocessing append the value in unary to rather than $\delta$ (as in the of Fischer and Heun). Thus, we can treat each push operation (with the of the first and last) corresponding to a single one bit in $T$ representing bits: bits $T_{\min}$ and one bit in $T_{\max}$ or two bits in $T_{\max}$ and one bit in $T_{\min}$, on the corresponding value in $U$. We store bit vector $B_{\min}$ of $2n$ which marks the position $T$ the bit to $(i n + 1)$-th of $T_{\min}$, for $0 \le i \le \lfloor \frac{2n}{\lg n}\rfloor$. We do the analogous procedure for $T_{\max}$ call the vector $B_{\max}$. now we the operations rank on $B_{\min}$, $B_{\max}$, and $T$. We structure of Lemma \[lem:rrr\] that for $B_{\min}$ and will occupy \binom{n}{\frac{n}{ \lg n}} + \frac{n \lg n}{\lg n}\right) = O\left(\frac{n \lg \lg n}{\lg n}\right)$$ and for $T$ will occupy no more than $2n + {\mathcal{O}}(\frac{n\lg\lg n }{\lg n})$ bits. data structures at this occupy $3n+o(n)$ bits total, the for We will how to recover $\lg n$ consecutive bits of $T_{\min}$; the procedure $T_{\max}$ is analogous. Consider the distances between two consecutive $1$ indices and $x_{i+1}$ in Suppose $x_{i+1} - x_{i} c n$ in $B_{\min}$, for $c 9


2.  Each bit in $T$ corresponds to at Least one biT in $T_{\mIn}$ oR $T_{\mAx}$. also RecaLl that at each stEP durIng preprocessing we appeNd the VaLUe $\deLTa-1$ In unaRy to $T$ raTHeR THan $\DeLtA$ (as In THe RepreSenTation oF Fischer anD HeUn). thus, we can treAT eAch push opeRatIon (with the exCepTion of ThE fiRSt and LasT) corrEspondINg to a sIngle one bIt IN $T$ as rePResentiNG ThRee bIts: two bits in $T_{\min}$ aND oNE bit in $T_{\max}$ or twO bits iN $T_{\MAx}$ AND onE biT in $T_{\min}$, depEnDing oN The corrESpONDIng VAlue in $U$. We storE a bit vector $b_{\Min}$ Of lengTh $2N$ whICh markS the pOsITioN in $T$ of the biT corRespondinG to the $(I \Lg n
      + 1)$-th biT Of $T_{\min}$, fOr $0 \le i \lE \lfLooR \fraC{2N}{\lG
        n}\RflOoR$. we dO ThE anALogOus proceDuRe For $T_{\mAx}$ anD CALL the ResUltiNg bit Vector $B_{\max}$.

SupPosE now THat We supPort tHe opErAtionS rank aNd selEcT on $B_{\min}$, $B_{\max}$, and $T$. we usE the data sTruCtUre Of lemma \[LEm:rrr\] tHat For $b_{\min}$ and $b_{\max}$ wilL OccUpY

$$o\LEfT(\lg \binom{n}{\frac{n}{ \lg n}} + \fRaC{N \Lg \Lg n}{\lg n}\riGht) = O\leFT(\fRaC{N \lg \lg n}{\lg N}\rIghT)$$

bitS, ANd for $t$ wilL OcCupy no moRe than $2N + {\MaThCal{O}}(\fraC{n\Lg\lg n
}{\lG n})$ BitS. ThUs, our DAta sTructuRes at thiS poinT Occupy $3n+o(n)$ bits iN Total, counting THe SPAcE For $U$. we wIll describe How tO RecoVer $\lG N$ cOnsECutivE bits Of $t_{\MiN}$; The procedure for $T_{\max}$ Is AnalogOus. CoNsider the distAnces betweEN TWo consecUtivE $1$ BiTS having indices $X_i$ and $X_{i+1}$ in $B_{\min}$. SuPPose $x_{i+1} - x_{i} \Le c \lg N$ in $B_{\min}$, fOr some conSTAnt $c \ge 9


2.  Each bit in $T$ corr esponds to  at l eas t o ne  bit  in$T_{\min}$ or$ T_{\ max}$. Also recall tha t atea c h st e pdurin g prepr o ce s s ing  w eapp en d  t he va lue  $\delt a-1$ in un ary  t o $T$ rather th an $\delta $ ( as in the re pre sentat io n o f  Fisc her  andHeun). Thus,we can tr ea t  eachp ush ope r a ti on ( with the exceptio n  o f  the first and  last)  c o rr e s pon din g to a sin gl e one bit in$ T$ a s  re p resenting thr ee bits: tw o  bi ts in$T _{\ m in}$ a nd on eb itin $T_{\max }$ o r two bit s in $ T _{\max} $  and on e bitin$T_ {\mi n }$ ,dep en d ing on  th e  co rrespond in gvalue  in$ U $ .  Westo re a  bitvector $B_{\m in} $ of len gth $ 2n$ w hich  m arksthe po sitio nin $T$ of the b it c orrespond ing  t o t he  $(i\ lg n
    +  1)$-th  bit of $T_ {\ m i n }$ , for $0 \le i \le  \ l f lo or \frac {2n}{\ l g      n}\ rf loo r$.W e  do t he a n al ogous pr ocedur e  f or  $T_{\m ax }$ and  c all  th e res u ltin g bitvector $ B_{\m a x}$.

Supposen ow that we su p po r t  t h e op era tions rankands elec t on $B _{\ m in}$,  $B_{ \m a x} $ , and $T$. We use t he  datastruc ture of Lemma  \[lem:rrr \ ] that for  $B_ { \m i n}$ and $B_{\m ax}$will occup y 

$$O\le ft(\l g \binom {n}{\frac { n }{ \lg n }}+ \ fra c{n \ lg  \lg n}{\lg n } \ righ t)  = O\le ft( \frac{n  \l g \ lgn}{ \l g n}\righ t)$$

bi ts ,an dfor  $T$w ill occu py  no  m ore  than $2n +{\mat hcal {O }} ( \fr ac{n\lg \ lg n 
}{\ lg  n })$bit s.  Thus , ou r  da ta stru ctures at  th i s po in toccupy$3n+o(n)$ bit sin total,co unt ing th e space fo r $U$. We will describe how torec over$\lg  n$ conse cut ive bi tso f $T_{ \min}$ ; the  p roc e d ure f o r  $ T_{ \m ax}$ is an a l ogo us. C on side r the d istances between t w o c onsecutive $1 $ b itsh a vi ngi nd i ces  $ x _i$ a nd $x_{i+1}$ in  $B_{\min} $. Su ppose $x_{ i +1}  -  x_{i}\le c \ lg n$ in $B_{ \min}$, f or some c on stan t $c\ge 9


2. _Each bit_in $T$ corresponds to_at least_one_bit in_$T_{\min}$_or $T_{\max}$. Also_recall that at_each step during preprocessing_we append the_value_$\delta-1$ in unary to $T$ rather than $\delta$ (as in the representation of Fischer_and_Heun). Thus,_we_can_treat each push operation (with_the exception of the first_and last)_corresponding to a single one bit in $T$_as_representing three bits:_two bits in $T_{\min}$ and one bit in $T_{\max}$_or two bits in $T_{\max}$ and_one bit in_$T_{\min}$,_depending_on the corresponding value_in $U$. We store a bit_vector $B_{\min}$ of length $2n$ which_marks the position in $T$ of the_bit corresponding to the $(i \lg_n
    _ +_1)$-th bit of $T_{\min}$, for_$0 \le i_\le \lfloor_\frac{2n}{\lg
  _     n}\rfloor$._We do the_analogous procedure for $T_{\max}$ and call_the_resulting bit vector_$B_{\max}$.

Suppose_now_that we_support the operations_rank_and select_on_$B_{\min}$, $B_{\max}$, and $T$. We use_the_data structure of Lemma \[lem:rrr\] that for $B_{\min}$_and $B_{\max}$ will occupy

$$O\left(\lg_\binom{n}{\frac{n}{_\lg n}} + \frac{n_\lg \lg n}{\lg n}\right) =_O\left(\frac{n \lg \lg n}{\lg n}\right)$$

bits, and_for $T$_will occupy_no more than $2n + {\mathcal{O}}(\frac{n\lg\lg n
}{\lg n})$ bits. Thus, our_data structures at this point occupy_$3n+o(n)$ bits in total,_counting the_space_for $U$. We_will_describe how_to recover $\lg n$ consecutive bits of_$T_{\min}$; the_procedure for $T_{\max}$ is analogous. Consider_the distances between two_consecutive_$1$ bits having indices $x_i$ and_$x_{i+1}$ in $B_{\min}$. Suppose $x_{i+1} -_x_{i} \le c \lg n$_in_$B_{\min}$,_for some constant $c \ge_9