Write a Java public static general function which doesn't belong to the Stack class,isGreaterThan that determines if one stack is greater than another stack. If the summation of every other item(starting at the top) from one stack is greater than the summation of every other item(starting at the top) from another, return true, otherwise, return false. After you call this method,both stacks should stay the same as they are called before.
Receives:a Stacktype argument S1 and another Stack type argument S2 Postcondition: If the summation of every other item (starting at the top) from S1 is greater than the summation of every other item (starting at the top) from S2, return true, otherwise, return false. Both S1 and S2 should stay the same as they are called before.
public static boolean isGreaterThan(Stack S1, Stack S2)
Already registered? Login
Not Account? Sign up
Enter your email address to reset your password
Back to Login? Click here