Answer the question
In order to leave comments, you need to log in
How popular are recursive functions?
Hello.
Student, 1st year.
The question arose: How popular are recursions in real or commercial development?
Are they used at all?
For example, in an indirect form for processing the same sequences of actions.
Answer the question
In order to leave comments, you need to log in
Recursive functions are not pop singers. they don't need to be popular.
But the programmer needs to learn what recursive functions are and use them for their intended purpose.
Yes, of course they are used.
I would say that everywhere and everywhere.
But there are also classes of problems that are usually solved in a recursive form. For example tree traversal.
Student, 1st year.
The question arose: How popular are recursions in real or commercial development?
Are they used at all?
For example, in an indirect form for processing the same sequences of actions.
"How popular are recursions in real or commercial development?"
The question is too student.
Recursion is common. Real or commercial development is conventional development. If the problem is easier to solve with recursion, then it is solved with recursion.
For example, popular sorting algorithms that are used everywhere use recursion.
Recursively, it is extremely convenient to write methods of recursive data structures like
type tree: //псевдокод
payload: node
left: tree
right: tree
As an example of a tree:
1) Recursion is used to process files in a directory.
Files are processed first, then directories are processed recursively.
Well, not only files, but structures in general organized in a similar way.
2) Localization of controls. There are controls on the panel, among which there are other controls and panels. It is necessary to change the name of the control to the value from the dictionary.
3) Tags and objects in the document. (XML, etc.)
4) Automation of the work of the organizational structure, for example, Active Directory. There is an organization, there are departments in it, in the department there are people (bosses ..) and other departments ...
5) Various catalogs with subdirectories of goods .. (when the nesting is not rigidly set and there are a lot of levels)
In short, this is basic knowledge that is used quite often. Without his knowledge, it is difficult to become a specialist, and when it is needed it is difficult to say, maybe now, or maybe never.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question