java - Convert method with loop for, without parameters, into a recursive method -


i have working method mostfrequent() loop 'for', need convert same recursive method mostfrequent() without parameters:

public char mostfrequent()     {         int maxnum = 0;         int num = 97;          for(int = 0; < 26; i++)         {             maxnum = howmany(num) //do something;             num++;         }         return ...something;     } 

a method howmany(num) recursive , don't want change it. need same method mostfrequent(), recursive, without loops. thanks.

int = 26;     int num = 97; public char mostfrequent() {     if(i == 0)         return .. something;     int maxnum = 0;     maxnum = howmany(num) //do something;     num++;     i--;      mostfrequent(); } 

i did information have, recursive.


Comments

Popular posts from this blog

c# - Validate object ID from GET to POST -

node.js - Custom Model Validator SailsJS -

php - Find a regex to take part of Email -