G2A Many GEOs
SHARE
TWEET

Untitled

a guest Mar 31st, 2020 66 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. public IEnumerator<T> GetEnumeratorYieldThree()
  2.         {
  3.             yield return Value;
  4.             if (Left != null)
  5.                 foreach (var elem in Left)
  6.                     yield return elem;
  7.             if (this.Right != null)
  8.                 foreach (var elem in this.Right)
  9.                     yield return elem;
  10.         }
  11.         public IEnumerator<T> GetEnumeratorYieldFour()
  12.         {
  13.             var q = new Queue<BinaryTreeNode<T>>();
  14.             q.Enqueue(this);
  15.             while (q.Count > 0)
  16.             {
  17.                 BinaryTreeNode<T> current = q.Dequeue();
  18.                 yield return current.Value;
  19.                 if (current.Left != null) q.Enqueue(current.Left);
  20.                 if (current.Right != null) q.Enqueue(current.Right);
  21.             }
  22.         }
  23.         public IEnumerator<T> GetEnumerator()
  24.         {
  25.             if (enumtype <= 2)
  26.                 return new BTEnum<T>(this);
  27.             else if (enumtype == 3)
  28.                 return GetEnumeratorYieldThree();
  29.             else if (enumtype == 4)
  30.                 return GetEnumeratorYieldFour();
  31.             else return new BTEnum<T>(this);
  32.         }
  33.         System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator()
  34.         {
  35.             return GetEnumerator();
  36.         }
RAW Paste Data
Ledger Nano X - The secure hardware wallet
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top