Esempio n. 1
0
 private static Queue CheckQ(int lenfm, List <T> .Node f, BootstrappedQueue <Lazy <List <T> .Node> > .Queue m, int lenr, List <T> .Node r)
 {
     if (lenr <= lenfm)
     {
         return(CheckF(lenfm, f, m, lenr, r));
     }
     return(CheckF(lenfm + lenr, f, BootstrappedQueue <Lazy <List <T> .Node> > .Snoc(m, new Lazy <List <T> .Node>(() => List <T> .Reverse(r))), 0, List <T> .Empty));
 }
Esempio n. 2
0
 public Queue(int lenfm, List <T> .Node f, BootstrappedQueue <Lazy <List <T> .Node> > .Queue m, int lenr, List <T> .Node r)
 {
     LenFM = lenfm;
     F     = f;
     M     = m;
     LenR  = lenr;
     R     = r;
 }
Esempio n. 3
0
 private static Queue CheckF(int lenfm, List <T> .Node f, BootstrappedQueue <Lazy <List <T> .Node> > .Queue m, int lenr, List <T> .Node r)
 {
     if (List <T> .IsEmpty(f) && m == null)
     {
         return(Empty);
     }
     if (List <T> .IsEmpty(f))
     {
         return(new Queue(lenfm, BootstrappedQueue <Lazy <List <T> .Node> > .Head(m).Value, BootstrappedQueue <Lazy <List <T> .Node> > .Tail(m), lenr, r));
     }
     return(new Queue(lenfm, f, m, lenr, r));
 }