Examlex
A palindrome is a word or phrase that reads the same forward or backward. Consider the following code snippet:
Public boolean palindrome(String string)
{
Return isPal(string, 0, string.length() - 1) ;
}
Private boolean isPal(String string, int left, int right)
{
If (left >= right)
{
Return true;
}
Else if (string.charAt(left) == string.charAt(right) )
{
Return isPal(string, left + 1, right - 1) ;
}
Else
{
Return false;
}
}
What is the purpose of the palindrome method?
Q3: Which of the following declares a sideLength
Q8: When implementing a queue as a singly-linked
Q8: You are creating a Vessel class which
Q20: Consider the following code snippet:<br>Public void deposit(double
Q24: Consider the following class:<br>Public class Auto<br>{<br>Private String
Q34: Which of the following statements about generic
Q40: Consider the following code snippet:<br>PriorityQueue<String> stringQueue =
Q68: Consider the following binary search tree: <img
Q70: In Big-Oh notation, selection sort is a(n)
Q86: Consider the following code snippet:<br>Public class Motorcycle