Search:

Type: Posts; User: sean1604

Search: Search took 0.29 seconds.

  1. Re: Using recursion to find the number of occurences of a character in a string

    thanks for the reply. I'm just starting out with recursion and was wondering if you could give me a bit more info on this part of the code:


    return 1 + freq(s.substring(1, s.length()), c);
    I get...
  2. Using recursion to find the number of occurences of a character in a string

    Having a bit of a problem with the recursive part of this case.

    here's what I have so far :

    public int freq (String S, Char C) {
    if (S.length () == 0) return (0); // base case
    else return //...
Results 1 to 2 of 2