D
D
Dmitry Belman2016-03-27 11:01:50
Java
Dmitry Belman, 2016-03-27 11:01:50

How to call a recursive method?

Good day.
With the help of recursion, I need to find the reverse in order of direct and centered traversal of a binary tree.
For example,

preordered = "ABCDGEFHIK"
inordered = "DGCBFEAKIH"

My problem is that when calling methods for processing the left and right subtrees relative to root A, I need to pass only DGCBFE and KIH to the methods, respectively. How can you pass to such a method when it is called a part of the array / list of characters, starting / ending with a certain index?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question