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
Type: Posts; User: cool_97
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
what about this function that i wrote
public void displayTree()
{
assistinOrder(root);
int level=0;
while(!q1.isEmpty()){
Node temp = q1.dequeue();...
mmmm good idea but first of all how to print them in each line
first the root
then two nodes
then 4 nodes .. etc
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
ok lets assume we have random values
it should print it like this
55
43 23
15 3 7 18
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);
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
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
This is the main class
-------------------------------
import java.io.*;
import java.util.*;
class TreeApp
{
public static void main(String[] args) throws IOException
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...
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