drawing  the call tree or a recursion trace with a given recursive function.

Posted on 2009-02-17
Last Modified: 2012-05-06
Professor told me that I have to be able to draw the call tree or a recursion trace with a given recursive function.  what does that mean? any example?
Question by:jiwonman
    LVL 86

    Expert Comment

    Hmm - quite a lot of these homework questions being asked ...
    LVL 92

    Accepted Solution

    you can get a call stack using:

    new Exception().printStackTrace();

    Or if you want to look at it programatticaly use:

            StackTraceElement[] stackTraceElements =

    See the example here:

    Featured Post

    How to run any project with ease

    Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
    - Combine task lists, docs, spreadsheets, and chat in one
    - View and edit from mobile/offline
    - Cut down on emails

    Join & Write a Comment

    Suggested Solutions

    Title # Comments Views Activity
    Conflicting setter definitions for property Exception 5 38
    MaxSpan challenge 9 51
    countAbc challenge 9 35
    for i loop in grovy 1 26
    For customizing the look of your lightweight component and making it look opaque like it was made of plastic.  This tip assumes your component to be of rectangular shape and completely opaque.   (CODE)
    Java had always been an easily readable and understandable language.  Some relatively recent changes in the language seem to be changing this pretty fast, and anyone that had not seen any Java code for the last 5 years will possibly have issues unde…
    Video by: Michael
    Viewers learn about how to reduce the potential repetitiveness of coding in main by developing methods to perform specific tasks for their program. Additionally, objects are introduced for the purpose of learning how to call methods in Java. Define …
    Viewers will learn about basic arrays, how to declare them, and how to use them. Introduction and definition: Declare an array and cover the syntax of declaring them: Initialize every index in the created array: Example/Features of a basic arr…

    733 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    21 Experts available now in Live!

    Get 1:1 Help Now