public void FindSolution(int numLimit)
        {
            for (int i = 0; i <= numLimit; i++)
            {
                expOneBh.Insert(new ExpressionOne(i, 0));
                expTwoBh.Insert(new ExpressionTwo(i, 0));
            }

            while(!expOneBh.IsEmpty() && !expTwoBh.IsEmpty())
            {
                AbstractTwoVarExpression exp = null;
                AbstractTwoVarExpression expOneTop = expOneBh.PeekTop();
                AbstractTwoVarExpression expTwoTop = expTwoBh.PeekTop();

                if(expOneTop.CompareTo(expTwoTop) <= 0)
                {
                    if (expOneTop.CompareTo(expTwoTop) == 0)
                        showExpressions(expOneTop, expTwoTop);

                    exp = expOneBh.DeleteTop();
                    if(exp.SecVar < numLimit)
                        expOneBh.Insert(new ExpressionOne(exp.FirstVar, exp.SecVar + 1));
                } 
                else
                {
                    exp = expTwoBh.DeleteTop();
                    if (exp.SecVar < numLimit)
                        expTwoBh.Insert(new ExpressionTwo(exp.FirstVar, exp.SecVar + 1));
                }
            }
        }
        public int CompareTo(object obj)
        {
            AbstractTwoVarExpression other = (AbstractTwoVarExpression)obj;

            if (Result > other.Result)
            {
                return(1);
            }
            else if (Result < other.Result)
            {
                return(-1);
            }
            else
            {
                return(0);
            }
        }
 private static void showExpressions(AbstractTwoVarExpression expOneTop, AbstractTwoVarExpression expTwoTop)
 {
     Console.WriteLine(expOneTop);
     Console.WriteLine(expTwoTop);
 }