Exemplo n.º 1
0
        public static ForwardList operator >(ForwardList left, ForwardList right)
        {
            ForwardList result = (ForwardList)right.Clone();

            result.GetLast().Next = ((ForwardList)left.Clone()).First;
            return(result);
        }
Exemplo n.º 2
0
        public static ForwardList operator +(ForwardList left, ForwardList right)
        {
            ForwardList result = (ForwardList)left.Clone();
            Iterator    cur = result.First, rightCur = right.First;

            while (cur != null && rightCur != null)
            {
                cur.Next = new Iterator(rightCur.Value, cur.Next);
                rightCur = rightCur.Next;
                cur      = cur.Next.Next;
            }

            cur = result.GetLast();
            while (rightCur != null)
            {
                cur.Next = new Iterator(rightCur.Value);
                rightCur = rightCur.Next;
                cur      = cur.Next;
            }

            return(result);
        }