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 does the condition left >= right refer to?
Q18: What operation is least efficient in a
Q42: If a min-heap has 1024 nodes, what
Q44: A min-heap is a binary tree structure
Q63: Suppose we have two String objects and
Q65: If your hashCode function returns a number
Q66: Suppose we are using binary search on
Q72: Insert the missing code in the following
Q73: Consider the following code snippet: LinkedList<String> myLList
Q97: Which sort algorithm starts with an initial
Q104: Select an expression to complete the program