Printing a Heap of BinaryTrees...help!

Ok, I have a tree full of BinaryTrees. I am 99% sure that my insert function works for inserting the BT's into the heap. I am getting a null pointer exception when I try to print the heap. Here is come of my code.
//Inserting the data into the heap.
for (int i = 0; i < letters.length; i++)
BinaryTree bt = new BinaryTree(letters);
bt.root.count = count[i];
heap.insert(bt);
//Printing the heap.
for (int i = 0; i < heap.array.length; i++)
System.out.println("[" + ((BinaryTree) heap.array[i]).root + "]: " + ((BinaryTree) heap.array[i]).root.count);
To explain some of this code.....
The input is a bunch of characters (ex. abbccccdddddd). It reads in a character and finds how every many of them there are (ex. a-1, b-2, c-4, d-6). Then, it will assign each character and its count to a root node in its own BinaryTree. Then the BinaryTrees are taken and stored in a Heap. I am getting a null pointer exception at the print statement. Any ideas?
-B

It is kinda late and Im tired and made some mistakes in the first line of my post. This is what it should be...
Ok, I have a HEAP full of BinaryTrees. I am 99% sure that my insert function works for inserting the BT's into the heap. I am getting a null pointer exception when I try to print the heap. Here is SOME of my code.

Similar Messages

  • How can I change the password in the iBook donated to our nonprofit.  No password was given with the iBook?  We need to put in printer and other software.  Help, we can use the laptop without changing the password.

      How can we change the password in the iBook donated to our nonprofit?  No password was given with the iBook and every time we try to install items, the password window pops up.  We need to put in printer and other software.  Help! We can use the laptop without changing the password.

    If you did not get an OS X install-restore DVD with the computer you may need
    to buy one from somewhere, and you may be lucky to get a retail OS X 10.5.x
    version. The original grey-label install set of software and OS X it shipped with
    likely would be an older system than Leopard 10.5. Last versions of G4 Mac, &
    G5, shipped with a Tiger 10.4 system; so did early Intel-based Mac. Grey discs
    which accompanied other computer build models generally do not interchange.
    The last OS X version a PowerPC architecture can use, if supported, is 10.5.8.
    A PPC processor at 867MHz & faster should be able to run OS X 10.5 Leopard.
    {With the correct disc installer, you can use it to change a password and other
    things including re-install, and perform disk utility functions, etc.}
    There is a chance you may be able to get a white-label Replacement 10.4 DVD
    or Replacement 10.5 DVD from AppleCare or the online Apple Store (800myapple)
    from a Mac OS X system specialist; these have been available yet hard to get
    as not all persons involved with them seem to know if they still exist until someone
    is asking. These aren't retail stock, are special discs for computers who could use
    a system later than original old discs; these are complete install discs not for one
    specific series of Mac. Generally they'd work in supported PowerPC G4/G5; but
    do not replace specialized original install DVD, such as an early Intel mac requires.
    You'd need to have a serial number of the computer, and a method of payment
    when seeking some replacement system media from Applecare or Apple sales
    and these discs are not available in a retail store. The original Retail discs are
    labeled differently and shipped in a retail box with a big X on the front. Other
    sources for retail 10.4 Tiger or 10.5 Leopard may be online via amazon sellers
    or computer resellers who handle repaired Macs. Avoid mystery grey label ones
    that were intended to be sold and kept with their original computer kits.
    Good luck!

  • Just updated the latest Epson software printer update from Apple. Now all my prints look solarized. How do I get rid of the new update and go back to the perfect prints I had before? Help please.

    Just updated the latest Epson software printer update from Apple. Now all my prints look solarized. How do I get rid of the new update and go back to the perfect prints I had before? Help please. Wasting ink and paper at the moment!!!!!!
    I have tried the printer with my laptop (not updated) and everything is fine. It's just the beautiful 27" Imac that can no longer print.

    Might be a corrupted printer preference file ...
    Open the Finder. From the Finder menu bar click Go > Go to Folder
    Type this exactly as you see it here:
    ~/Library/Preferences
    Click Go
    Move the com.apple.PrinterPrefs.plist file from the Preferences folder to the Trash.
    Restart your Mac, restart the printer...

  • Is it possible to print the info. from the help window. (ex. how to create a smart list)

    is it possible to print the info. for the help window. (ex. how to create a smartlist... i tunes)

    Yes, click the gear icon and select print.

  • On my HP printer Officejet4620 I get an error message "waiting for printer to become available".  Help please?

    On my HP printer Officejet4620 I get an error message "waiting for printer to become available".  Help please?

    Restart the computer and restart the printer. If you continue to have the problem the follow the steps Apple outlines in Reset Printing System feature article.

  • Hi....is it possible to print from iPad to a HP Officejet Pro 8500 A909 printer?  Thanks for any help!

       Hi....is it possible to print from iPad to a HP Officejet Pro 8500 A909 printer?  Thanks for any help!

    The HP Officejet Pro 8500 A909 is not an AirPrint printer, if that is what you're asking. HP has proprietary apps that may be suitable for your needs.
    To print directly from an iPad / iPhone you will need an AirPrint compatible printer or another device to act as a print server. That can be a Mac computer running Printopia ($19.95 with free trial) or handyPrint (donation - supported). The Mac must be "on" but may be asleep for them to work. Equivalent PC options may exist but you're on your own finding them.
    You can also buy this standalone print server:
    http://www.lantronix.com/it-management/xprintserver/xprintserver.html
    These options enable you to use any printer available to your Mac, even older ones that may predate AirPrint by decades.
    Otherwise you will need to buy an AirPrint printer or multifunction device.

  • I can only print 1 page can somebody help

    I can only print 1 page can somebody help
    sl

    I have the same problem with my HP C6380 MY8CJ880F6. For me it is +80% of what I am printing I only get 1 page and has to print the rest 1 by 1. The problem is 6 month old and I have tried almost everything except the right solution ;-}
    Setup Windows 7, 64 bit (Danish). Wireless communication.
    I have tried reinstalling, use HP diagnostics and a lot of other things. Diagnostics says everything is fine. Microsoft Fix It diagnostics says the same about the Windows 7 printer support functions.
    My other printer a HP Designjet 111 runs perfect. When I am out of office I use other printers no problems. But the HP C6380 will in most applications especially Acrobat Reader only print 1 page at a time.
    I have tried to change the printer into factory settings that sometimes do the trick for the Microsoft Office 10 products installed but not for Acrobat. Most of my documents are PDF so either i get the fixed or I will have to invest in another printer.
    Any body with a solution ?
    BR Erik

  • Have renewed my ExportPDF Subscription, but still pop's up with "Your trail has expired" window when go to convert via Print driver window. Comments/ help welcome thanks :-)

    Have renewed my ExportPDF Subscription, have the confirmation email, but still pop's up with "Your trail has expired" window when go to convert via Print driver window. Comments/ help welcome thanks :-)

    Hi azza675,
    ExportPDF converts PDF files to Word and Excel formats (and several others). What you describe, sounds like you're trying to convert a file *to* PDF. Did you ever start a trial of Acrobat, perhaps? (Whereas you can create PDFs with Acrobat, ExportPDF doesn't let you convert files to PDF.)
    What happens when you log in directly to ExportPDF at https://cloud.acrobat.com/exportpdf?
    Best,
    Sara

  • I switched to Apple Mail in the last two months.  When I attempt to print an email message, I get a blank piece of paper.  When I attempt to use the print options suggested in "Mail Help", the program crashes and has to be reopened.  Any ideas?

    I switched to Apple Mail in the last two months.  When I attempt to print an email message, I get a blank piece of paper.  When I attempt to use the print options suggested in "Mail Help", the program crashes and has to be reopened.  Any ideas?

    Which version of Mail are you using as well as which Snow Leopard version you are using? 

  • Error Message:"Cannot find or create the font 'WP-MathA'. Some characters may not display or print correctly."  Who can help me solve this problem?

    Some of the pdf files I work with (receive) come up with a comment: “Cannot find or create the font ‘WP-MathA’. Some characters may not display or print correctly.”  Who can help me solve this problem?
    Thank you in advance for  your time.
    Marlen

    Hello Anubha,
    I am having a similar problem on my machine.  I was using Word 2008 and I created a PDF inside Word.
    I am opening the file on the system itself and I am running Windows 8.1.  I am using Version 11 of Reader.
    When the PDF I created (my resume) attempts to open, it says:  cannot find or create the file Times, Bold.  Some characters may not display or print correctly. 
    However, the entire Reader keeps freezing and will not allow me to open or test print the document.  Also, it is not displaying any of the Bold Times New Roman Print.  Can you please help?  Thanks.

  • My photoshop CS5 crashes every time I try to print...can anyone help me?

    My photoshop CS5 crashes every time I try to print...can anyone help me? 
    Thank you

    Mine too. In fact, after 4 years my iMac is acting very strange. It is acting like a virus on a PC. Everything I read says that is not possible.  Wish I knew what to do.

  • HT1338 I can see my photos in iphoto but can't email them, edit them or print them....help please!

    I can see my photos in iphoto but can't email them, edit them or print them....help please!

    First, what is the formatting of the external hard drive?  It should be OS X Extended (journaled). You can determine it by selecting the EHD and typing Command + i. 
    Click to view full size
    If it isn't formatted to that you should move the library off of it and reformat.
    The "!" is an indication that the file path to the original file has been broken  So make a temporary, duplicate copy of the library and apply the two fixes below in order as needed:
    Fix #1
    Launch iPhoto with the Command+Option keys held down and rebuild the library.
    Select the options identified in the screenshot. 
    Fix #2
    Using iPhoto Library Manager  to Rebuild Your iPhoto Library
    Download iPhoto Library Manager and launch.
    Click on the Add Library button, navigate to your Home/Pictures folder and select your iPhoto Library folder.
    Now that the library is listed in the left hand pane of iPLM, click on your library and go to the File ➙ Rebuild Library menu option
    In the next  window name the new library and select the location you want it to be placed.
    Click on the Create button.
    Note: This creates a new library based on the LIbraryData.xml file in the library and will recover Events, Albums, keywords, titles and comments but not books, calendars or slideshows. The original library will be left untouched for further attempts at fixing the problem or in case the rebuilt library is not satisfactory.
    OT

  • Lexmark S400 and iPad 2 says no printer found. Can anyone help...thanks.

    Hi...I have iPad 2 and a Lexmark S400 series all is fine with the air (wireless) printing on my Mac laptop and my dell laptop, all works fine but my iPad 2 say no printer found. Can anyone help...thanks.

    That model is not listed as supporting air print.
    http://support.apple.com/kb/ht4356

  • I have installed my brother computer and is in my printers and devices but is not coming up as a printer option in adobe pdf Help I was able to print PDFS before installing adobe now I cant

    I have installed my brother computer and is in my printers and devices but is not coming up as a printer option in adobe pdf Help I was able to print PDFS before installing adobe now I cant

    Be sure Safari does not have the Block Pop-Up Windows preference set.
    Where I work now there are several unencrypted VLANs that require authentication, and Safari promptly pops up a window for me to register every time.

  • I upgrade succesfully my laptop OS from mountain lion to maverick. i have my canon IR 2530 driver installed. after i reset my printer, the driver is not showing from Printer Software. could you guys help me to solve these problem?

    I upgrade succesfully my laptop OS from mountain lion to maverick. i have my canon IR2530 driver installed. after I reset my printer and add again(Canon IR2530), the driver is not showing from Printer Software. could you guys help me to solve these problem?

    Maybe this thread will help:
    https://discussions.apple.com/message/23873672#23873672

Maybe you are looking for

  • How to get the values in separate columns

    Hello Everyone I am new to Bex, i have the sales data of 2008,2009,2010. now i have to display the sales order(key figure) for 2008,2009,2010 in separate columns for each customer(dimension) in a single report , can any one help me how to get this do

  • Can i use the same itunes account for 2 iphones?

    CAN YOU USE 2 IPHONES WITH 1 ITUNES ACCT?

  • Mavericks: cannot decrypt S/MIME email

    Mavericks 10.9.4 on MacBook Air, using latest Apple Mail v7.3 (1878.6). I can send and receive (verify) signed S/MIME email, and send encrypted S/MIME email. Problem: I cannot read received encrypted email, even email that I myself send to my own add

  • IMac 2013 and PC via Thunderbolt in TDM

    Hi all, today I do have an IMAC 2010 connecte to a PC via a display port cable. This works fine and is a perfect solution to limit the space used on the Desk. So now I am planning to move on to an IMAC 2013. As those new models do no longer supply a

  • Access properties of component within an itemRenderer

    I have a VBox (vbox1.mxml) component that contain a 2 childs component, which is Image and Label. Some snapshots of the code is <!-vbox1.mxml - -> <mx:VBox> <mx:Image id="videoImg" width="100%" height="100%" cachePolicy="off" source="{data.videoImage