Ejemplo n.º 1
0
 public static T Peek <T>(Deque <T> deque, int index)
 {
     return(deque[index]);
 }
Ejemplo n.º 2
0
 public static T Peek <T>(Deque <T> deque)
 {
     return(deque[0]);
 }
Ejemplo n.º 3
0
 public static int IndexOf <V>(Deque <V> a, V entry, int index)
 {
     return(a.IndexOf(entry, index));
 }
Ejemplo n.º 4
0
 /// <summary>
 /// Returns the first position from the end inwards of entry in the deque a
 /// </summary>
 /// <param name="a">A Deque, i.e. double ended queue.</param>
 /// <param name="entry">The value to search for.</param>
 /// <returns>The first position from the end inwards of entry in the deque a, -1 if entry not in a.</returns>
 public static int LastIndexOf <V>(Deque <V> a, V entry)
 {
     return(a.LastIndexOf(entry));
 }
Ejemplo n.º 5
0
 /// <summary>
 /// Checks if Deque <paramref name="a"/> is a superdeque of <paramref name="b"/>.
 /// Requires a to contain more or same number of entries than b and same values at same position for being true.
 /// </summary>
 /// <param name="a">A Deque.</param>
 /// <param name="b">Another Deque of compatible type to <paramref name="a"/>.</param>
 /// <returns>Boolean result of Deque comparison.</returns>
 public static bool GreaterOrEqual <V>(Deque <V> a, Deque <V> b)
 {
     return(LessOrEqual(b, a));
 }