User Profile

Collapse

Profile Sidebar

Collapse
JennaCoder
JennaCoder
Last Activity: Apr 1 '13, 04:39 AM
Joined: Mar 31 '13
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • I did this but kept getting un correct result can someone help me fix it up?

    Code:
    public class CompareStrings { 
    public static boolean match(String x, String y) {
        return match(x.toCharArray(), y.toCharArray(), x.length() - 1, y.length() - 1);
    }
    
    private static boolean match(char[] x, char[] y, int xPosition, int yPosition) {
        if (xPosition < 0 || yPosition < 0) {
            return false;
    ...
    See more | Go to post

    Leave a comment:


  • I need to know how to do it with recursion for a test,:(
    See more | Go to post

    Leave a comment:


  • I want to compare the string using recursion also a wild card for example The matching process should allow "wild cards". A '@' character will match with any other single character and a '*' character will match with 0 or more characters of any type.
    See more | Go to post

    Leave a comment:


  • This is what I did but it doesnt seem to work keep getting false for all of them.
    Code:
    public class CompareStrings { 
    public static boolean match(String x, String y, boolean wildCard ) {
    	//Both strings are empty
    	if((x.length() == 0) &&(y.length()==0))
    		{
    			return true;
    		}
    	//Second string is empty and there is wildCard character
    	if(y.length() == 0 && wildCard)
    		{
    ...
    See more | Go to post

    Leave a comment:


  • How can i get the following result using only recursion

    Code:
    public static void main(String args[]) { 
     System.out.println(match("hello", "hello.")); // should return false
     System.out.println(match("hello", "jello")); // should return false
     System.out.println(match("hello", "h@llo")); // should return true
     System.out.println(match("hello", "h@@@@")); // should return true
     System.out.println(match("hello",
    ...
    See more | Go to post
    Last edited by Rabbit; Mar 31 '13, 07:00 AM. Reason: Please use code tags when posting code.
No activity results to display
Show More
Working...