Code Newbie
News     Forums     Search     Members     Sign Up    

My Code Newbie
Username

Password

Articles/Snippets
ASP Classic
ASP.NET
C
C#
C++
HTML / CSS
Java
Javascript
Linux / BSD
Perl
PHP
Python
Ruby
SQL
VB 6
VB.NET

C.N. Friends
  Planet Rome

Link to Us!
Code Newbie
  Code Newbie
    forums
Old 02-02-2004, 07:01 PM   #1 (permalink)
babyf33t
Registered User
 
Join Date: Apr 2003
Posts: 2
babyf33t is on a distinguished road
IntTreeBag levelprint help

Hi

I'm having trouble with my levelprint method

The teacher wants us to print the tree from the root down like:
2
14

and if it's an empty node a dash

She wants us to use a queue and I don't understand why

please help
babyf33t is offline   Reply With Quote
Old 02-13-2004, 04:37 AM   #2 (permalink)
Belisarius
Java fanboy
 
Belisarius's Avatar
 
Join Date: Aug 2003
Posts: 1,161
Belisarius is on a distinguished road
Sorry for the slow reply, haven't been on in a while.

While I don't fully understand the assignment, I assume this is for an intro programming class.

How does your teacher want you to use a queue? If you have a tree, writing a toString() methods makes more sense, if all you need to do is display the thing.

If this is anything like the assignment I had to write a b-tree, the queue would be more appropriately called a "cache", the queue holding part of the tree allowing for quicker reference to commonly accessed elements.

But that's making a possibly invalid assumption in regards to what your teacher meant by "use a queue".
__________________
GitS
Belisarius is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -8. The time now is 05:20 AM.


Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.0.0 RC8





Copyright © 2000-2008, Milano Interactive
Web Hosting provided by Portal 360 Web Hosting