Search:

Type: Posts; User: cool_97

Search: Search took 0.11 seconds.

  1. Replies
    18
    Views
    1,432

    Re: Help in printing trees

    ok i get it but how to put on first line just the root
    then put on second line the children of the root left and right then their children
  2. Replies
    18
    Views
    1,432

    Re: Help in printing trees

    what about this function that i wrote

    public void displayTree()
    {
    assistinOrder(root);
    int level=0;
    while(!q1.isEmpty()){
    Node temp = q1.dequeue();...
  3. Replies
    18
    Views
    1,432

    Re: Help in printing trees

    mmmm good idea but first of all how to print them in each line
    first the root
    then two nodes
    then 4 nodes .. etc
  4. Replies
    18
    Views
    1,432

    Re: Help in printing trees

    i'm not insulting him but he said that no one will write "the code for you"
    and i'll be thankfull if he could help
    anyway his effort is realy appreciated
  5. Replies
    18
    Views
    1,432

    Re: Help in printing trees

    ok lets assume we have random values

    it should print it like this



    55
    43 23
    15 3 7 18
  6. Replies
    18
    Views
    1,432

    Re: Help in printing trees

    this is the code

    {
    int dep=getHeight();
    System.out.printf("Height is %d\n",dep);

    //Queue q2 = new Queue();
    Node current = root;
    int counter = 1;
    helpdispley(current);
  7. Replies
    18
    Views
    1,432

    Re: Help in printing trees

    need to know how to write it the idea algorithm anything
    ii seems that the only one who check and help is you
    so i'm doomed
  8. Replies
    18
    Views
    1,432

    Re: Help in printing trees

    in class tree
    u could notice a function called
    public void displayTree()
    need to complete this function
    and i need it to print the tree level by level
  9. Replies
    18
    Views
    1,432

    Re: Help in printing trees

    This is the main class

    -------------------------------

    import java.io.*;
    import java.util.*;
    class TreeApp
    {

    public static void main(String[] args) throws IOException
  10. Replies
    18
    Views
    1,432

    Re: Help in printing trees

    ok

    don't know how to put it like u guys so i will just copy it here

    -----------------------

    // tree.java
    // demonstrates binary tree
    // to run this program: C>java TreeApp
    import...
  11. Replies
    18
    Views
    1,432

    Help in printing trees

    Hi
    i have this class but it's missing print the tree
    need to print them level by level

    hope anyone could help asap

    thx in advance
    663
Results 1 to 11 of 11