Simplify computed properties

Some computed properties in Queue<T> and Stack<T> were simplified by
using ternary operators.