To the computer scientists: what do you think of this code with recursion for the Fubonaacü calculation?

STack I understood or good or

 

public class Main

 { public static void main(String[] args) { fibonatschü(); } public static void fibonatschü(){    fibonatschüue(0,1); } public static void fibonatschüue(int eins, int zwei){ if(eins > 50 ) return; System.out.print( zwei+" "); fibonatschüue(zwei, zwei+eins); } }
(1 votes)
Loading...

Similar Posts

Subscribe
Notify of
9 Answers
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
fronaldfruck
1 month ago

It’s okay. But whether I would still learn Java today….

fronaldfruck
1 month ago
Reply to  KleinerDulli

zB Python would I recommend

Ireeb
1 month ago

You can actually ask ChatGPT very well and get code examples generated and explained. The more extensive a program becomes, the more the AI makes mistakes, but just such rather short functions actually always make it error-free. Then you can also ask what there are ways to restructure or shorten this function.
In addition, an AI cannot feel a foreign shame, which is another advantage.

Ireeb
1 month ago

No, I just described the coding piece shown. Are you code?

Ireeb
1 month ago

Then it would fit perfectly with this coding style.

Which programming language is the best depends on what you want to do with it. Doesn’t give any programming language that can do anything well.

Python is widely used in the field of AI and machine learning, and generally in more complex software as a scripting level.