How many different binary search trees can store the keys {1,2,3}

I am having a hard time answering this question:
How many different binary search trees can store the keys {1,2,3} or how about {1,2,3,4} and how did u figure this out?
Any responses helpful
Thanks!

the.maltese.falcon wrote:
practissum, shame on you for doing this chap's homework for him. @ the OP, this is a Java forum, not a basic data structures forum.
Also, you forgot the cases
3
1
2and
1
3
2
the.maltese.falcon, I was just trying to help him get started with the base case. Notice that I didn't enumerate all of the possibilities, but was trying to help the OP get on the right track. You, however, have done this. So shame to you, sir!

Similar Messages

  • HT204053 how many different apple id's can share the same music / itunes and cloud?

    hello --
    i have 120gb music on my itunes shared aound a pc / iphone and 2 x ipads,
    i have x1 apple id for the phone / pc and a different one ( i think) for one of the ipads.
    my son on his laptop created his own apple id and libray but shares access to my libray also
    NOW I WANT TO ADD MY DAUGHTER TO ITUNES AND ALLOW HER ACCESS TO MY / OUR LIBRAIRES..
    HOW MANY APPLE ID'S CAN ACCESS / SHARE THE SAME MEDIE LIBRAIES?
    THANKS

    hello --
    i have 120gb music on my itunes shared aound a pc / iphone and 2 x ipads,
    i have x1 apple id for the phone / pc and a different one ( i think) for one of the ipads.
    my son on his laptop created his own apple id and libray but shares access to my libray also
    NOW I WANT TO ADD MY DAUGHTER TO ITUNES AND ALLOW HER ACCESS TO MY / OUR LIBRAIRES..
    HOW MANY APPLE ID'S CAN ACCESS / SHARE THE SAME MEDIE LIBRAIES?
    THANKS

  • How many different iPods can I sync with my single iMac user/iTunes account?

    Good Day to All,
    Can anyone tell me how many different iPods & iPhones can I successfully consistently sync/integrate using my one "user account" in iTunes on my iMac? This ist situation:
    I have always (and only) synced etc. my iPhone with my one iTunes UID which is under my ONE "User Account" on my  iMac. Recently, my elderly folks gave me 2 iPods they have never used. One is a little silver 4GB shuffle (the little guy with a built on "belt clip" & it verbally tells you what song and artist is playing. The other is also an iPod shuffle ( only 1GB), also has the metal "pinch to open; belt clip"; also no display, however it came with a little USB Dock and THIS ONE has all of the user controls on the face of it in a circular patter of course..
    To have COMPLETE successful "interaction/integration/syncing" etc (with no issues/complications etc) with my iTunes currently and previously only used with my iPhone, do I have to create two new additional "User Login/accounts" on my iMac (one for each iPod) to have all three if my devices work perfectly fine, or can I just use my same iMac login (UID) & iTunes that I use with my iPhone and have no worries?
    (ie: I created my girlfriend her own iMac login UID which she has always used for backing up/syncing etc her iPhone with HER iTunes library etc)
    In short, does iTunes have the ability to have multiple iPods & my iPhone under my one existing iTunes account AND using the same single iMac login/UID I've always used with my iPhone?
    Obviously, I know I could create an iMac login for my mom's, another for my dad's & create them both their individual iTunes accounts, but they really don't want to have to worry about dealing with all that. I'm teetering between just treating them as my iPods and mixing/adding their limited CD's into my library (again, if iTunes allows multiple iPods etc as explained above..
    OR; my other thought would be (again, if one iTunes account can integrate the two iPods as seperate devices and to just create ONE iMac UID login and ONE iTunes account under my dad's name, and use that one account for both of their music, both of their iPods, importing their CD's into the same iTunes library, then when syncing etc. just doing selective transfers/sync's of the specific music for each iPod... Even then, will iTunes be able to differentiate the two as far as backups/restored etc? I think  answering my own question as I type due to the cloud... For completely individual cloud interaction/integration, I would def need to create each of them their own iTunes accounts, otherwise they will have all of each other's songs on their devices.. (ie: And my dad def doesn't want to worry about skipping over my mom's Journey or Aerosmith tunes to get to his Willie Nelson and vice versa for example.
    (Sorry sooooo drawn out; thinking outloud) I guess it seems obvious that since all their digital music has to be on my iMac, I really should create them each their own iMac UID login as well as their own individual iTunes Acounts to insure cloud services work easily for restores/backups etc...
    Thanks for stumbling thru my thought processes here (if I didn't lose ya long ago); I'm exhausted and throwing thoughts at the classroom board to see what sticks.... The best easiest way that is.. (The two aren't always the same obviously!)
    Thank you all for your precious time and consideration and most if all; YOUR PATIENCE!! Any confirmation if the options and suggestions are greatly appreciated. You know, gotta take care of the folks & what is the simplest for them as just end users is the most important or they'll NEVER bother with them in the end...
    Respectfully appreciative,
    DB

    You can use as many iPods with one iTunes library as you want.
    (108420)

  • Basic binary search tree question

    Hi,
    I was just wondering, if there's a binary search tree that holds objects can the binary search tree be based on any of the attributes in those objects.
    So for example say we have a Person object and it has the attributes name, age, and height. Can we make a binary search tree based on the age or a search tree based on just the height.
    And lastly how would that be done in the comparable method.
    Thanks.

    Of course it depends on what (and whether) the Person class implements for Comparable. If you want to base the tree on the default comparison (i.e., the one that compareTo does) then you don't need a separate Comparator.
    When you write your binary tree implementation, it's wise to make it smart enough to either take a Comparator, or to use the default comparison (if the objects being tracked implement Comparable).
    Note that Comparators and Comparable have nothing to do with trees per se. It's not like a tree necessarily needs one or the other. It's simply very smart to use the existing Java framework to determine an order among objects.

  • How can I calculate total path length of a Binary Search Tree?

    I have been trying to learn binary search trees, but I can't figure out a way to calculate the total path length and the number of leaves in a BST. I will utilize a linked list for the nodes in the tree. I will be using an innerClass for the nodes; each node will have a variable for an element and links for the left and right. Does anyone have any idea on how to calculate this? Thanks in advance.:)

    By the way, all of the elements are comparable objects.

  • In how many different computers can I install my snow leopard?

    In how many different computers can I install my snow leopard?
    The one that came when I bought my Macbook Pro.

    Kappy, I believe that he's asking about Snow Leopard, not Lion. Your answer would be correct in reference to Lion purchased from the Mac App Store, but not Lion shipped as original OS on a new Mac.
    derojas, assuming you have a standard OEM, it-came-with-the-computer Snow Leopard installer, you are licensed to use it only on that one computer. You are not licensed to install it on any others. Many OEM discs can install only on the specific hardware model with which they shipped, anyway.
    If you have a standard retail installer, it's technically possible to install it on any Mac capable of running Snow Leopard. However, again, the license grants you the freedom to install it on only one Mac at a time (i.e. you'd have to delete it from one Mac before you could install it on another).
    There are family packs and other multi-licensing arrangements that permit the owner to install Snow Leopard on more than one Mac. You need to check the license to find out how many and what other restrictions might apply.

  • How many different computers can i sync my ipod to and transfur music from?

    how many different computers can i sync my ipod to and transfur music from? i am trying to sync my ipod to another laptop and add my music to that computer but i was wondering if there was a limit on how many computers you can do that with. thanks all.

    You can authorize up to five computers for your iTunes purchases.
    If manually managing your device you can add content from any library.
    If automactially syncing content is managed from one library.
    Purchased content can be transfered from a device into an authorised library, otherwise iTunes only transfers content to the device.
    tt2

  • HT1386 How many different computers can I sync my iPod with?  My laptop crashed and was completely wiped clean and this was the machine that my iPod synced with so I don't know if it will be counted as a "new" computer.

    How many different computers can I sync my iPod with?  My laptop crashed and was completely wiped clean and this was the machine that my iPod synced with so I don't know if it will be counted as a "new" computer when I sync my iPod.

    You can sync with onee at a time. Syncing to another will erase the current content.
    Copy everything from your backup copy of your old computer to your new one.

  • How many days we can store the data  in psa & ods ?

    hi guru's
    how many days we can store the data  in psa & ods ?
    Thanks & Regards.
    Prabhakarreddy

    Hi Prabhakarreddy,
    As many days as you like:
    In the PSA you can keep data as long as you like but you will need more and more disk-space. So its advisable to clean up from time to time.
    Example:
    PSA's from full loads Clean up in a weeks time,
    PSA's from Deltas: Clean up after you are sure data is correct. (e.g. a month or 90 days)
    Remember that you cannot do a reconstruction from dataloads of which you have deleted the PSA. If some thing is wrong you will have to do an Init again!
    In ODS's you must keep data in order to keep your delta loads to cubes in order. Removing data will force you to do a new initial load.
    Sometime companies delete old data form ODS's that is older than a certain period (e.g. more than 3 years old) by running a selective deletion. You will have to do an init again. But loads and activation may run faster and of course you gain on disk space.
    Udo

  • How many years we can store the data in ODS as well as psa data ?

    Hi guru's
    how many years we can store the data in ODS? can u give particular years ?
    how many days we can store the data in psa ? could u tell me step by step procedure ?
    Thanks
    Reddy prabha

    Hi Prabhakarreddy,
    As many days as you like:
    In the PSA you can keep data as long as you like but you will need more and more disk-space. So its advisable to clean up from time to time.
    Example:
    PSA's from full loads Clean up in a weeks time,
    PSA's from Deltas: Clean up after you are sure data is correct. (e.g. a month or 90 days)
    Remember that you cannot do a reconstruction from dataloads of which you have deleted the PSA. If some thing is wrong you will have to do an Init again!
    In ODS's you must keep data in order to keep your delta loads to cubes in order. Removing data will force you to do a new initial load.
    Sometime companies delete old data form ODS's that is older than a certain period (e.g. more than 3 years old) by running a selective deletion. You will have to do an init again. But loads and activation may run faster and of course you gain on disk space.
    Udo

  • How many different email accounts can I put on the iPhone?

    I was wondering how many different email accounts the iphone can handle?

    Cant say the exact amount but my iphone handles 6 various accounts with no problems. Understand if you have all them accounts checking email every 15 mins then it will drain a large amount of battery. you can get around this by mail forwarding to just one account it will save battery trust me. All the large email account providers Gmail, Hotmail etc all have this feature now available.

  • I have a lion server set up to host storage for time machine backups. Is there a limit to how many different computers can back up to the single server to back up. I am only backing up the users folders . The backup drive is an external Drobo with 6 TB.

    I have a lion server set up to host storage for time machine backups. Is there a limit to how many different computers can back up to the single server to back up. I am only backing up the users folders . The backup drive is an external Drobo with 6 TB. Right now it seems to back up my users all day long. I set their time machine interval to every 5 hours but it still runs all day long and is very slow. Server is on a new Mac Server mini.

    AFAIK, there is no user limit.. it is simply a question of the network load. AFP is a fairly clean protocol.. but TM is not.. it does a lot of testing of the backup.. infact your setting of 5hour gap could well make it worse.
    I would sort out the clients that are doing 100GB backups to a different backup location.. no matter how fast your network.. 100GB takes time to backup.. and over wireless forever.. it will never end.
    I guess some of these clients are on wireless?? I would separate the TM of wireless to those that are wired. No more than 4 or 5 wireless clients to a target device. Otherwise you are saturating your network with backup data. And use 5ghz.. so close by.. it is much faster than 2.4ghz and you will get much better transfer rates.

  • How many different podcasts can you submit to iTunes on one account?

    How many different podcasts can you submit to iTunes on one account?
    17" MBP dual core 2.16   Mac OS X (10.4.8)  

    I've submitted at least a half dozen so far, and all were accepted.
    Mitchell A.
    Producer and host
    BuzzBender More Buzz. No Filler.
    G4   Mac OS X (10.3.9)  

  • Binary search tree in java using a 2-d array

    Good day, i have been wrestling with this here question.
    i think it does not get any harder than this. What i have done so far is shown at the bottom.
    We want to use both Binary Search Tree and Single Linked lists data structures to store a text. Chaining
    techniques are used to store the lines of the text in which a word appears. Each node of the binary search
    tree contains four fields :
    (i) Word
    (ii) A pointer pointing to all the lines word appears in
    (iii) A pointer pointing to the subtree(left) containing all the words that appears in the text and are
    predecessors of word in lexicographic order.
    (iv) A pointer pointing to the subtree(right) containing all the words that appears in the text and are
    successors of word in lexicographic order.
    Given the following incomplete Java classes BinSrchTreeWordNode, TreeText, you are asked to complete
    three methods, InsertionBinSrchTree, CreateBinSrchTree and LinesWordInBinSrchTree. For
    simplicity we assume that the text is stored in a 2D array, a row of the array represents a line of the text.
    Each element in the single linked list is represented by a LineNode that contains a field Line which represents a line in which the word appears, a field next which contains the address of a LineNode representing the next line in which the word appears.
    public class TreeText{
    BinSrchTreeWordNode RootText = null;// pointer to the root of the tree
    String TextID; // Text Identification
    TreeText(String tID){TextID = tID;}
    void CreateBinSrchTree (TEXT text){...}
    void LinesWordInBinSrchTree(BinSrchTreeWordNode Node){...}
    public static void main(String[] args)
    TEXT univ = new TEXT(6,4);
    univ.textcont[0][0] = "Ukzn"; univ.textcont[0][1] ="Uct";
    univ.textcont[0][2] ="Wits";univ.textcont[0][3] ="Rhodes";
    univ.textcont[1][0] = "stellenbosch";
    univ.textcont[1][1] ="FreeState";
    univ.textcont[1][2] ="Johannesburg";
    univ.textcont[1][3] = "Pretoria" ;
    univ.textcont[2][0] ="Zululand";univ.textcont[2][1] ="NorthWest";
    univ.textcont[2][2] ="Limpopo";univ.textcont[2][3] ="Wsu";
    univ.textcont[3][0] ="NorthWest";univ.textcont[3][1] ="Limpopo";
    univ.textcont[3][2] ="Uct";univ.textcont[3][3] ="Ukzn";
    univ.textcont[4][0] ="Mit";univ.textcont[4][1] ="Havard";
    univ.textcont[4][2] ="Michigan";univ.textcont[4][3] ="Juissieu";
    univ.textcont[5][0] ="Cut";univ.textcont[5][1] ="Nmmu";
    univ.textcont[5][2] ="ManTech";univ.textcont[5][3] ="Oxford";
    // create a binary search tree (universities)
    // and insert words of text univ in it
    TreeText universities = new TreeText("Universities");
    universities.CreateBinSrchTree(univ);
    // List words Universities trees with their lines of appearance
    System.out.println();
    System.out.println(universities.TextID);
    System.out.println();
    universities.LinesWordInBinSrchTree(universities.RootText);
    public class BinSrchTreeWordNode {
    BinSrchTreeWordNode LeftTree = null; // precedent words
    String word;
    LineNode NextLineNode = null; // next line in
    // which word appears
    BinSrchTreeWordNode RightTree = null; // following words
    BinSrchTreeWordNode(String WordValue)
    {word = WordValue;} // creates a new node
    BinSrchTreeWordNode InsertionBinSrchTree
    (String w, int line, BinSrchTreeWordNode bst)
    public class LineNode{
    int Line; // line in which the word appears
    LineNode next = null;
    public class TEXT{
    int NBRLINES ; // number of lines
    int NBRCOLS; // number of columns
    String [][] textcont; // text content
    TEXT(int nl, int nc){textcont = new String[nl][nc];}
    The method InsertionBinSrchTree inserts a word (w) in the Binary search tree. The method Create-
    BinSrchTree creates a binary search tree by repeated calls to InsertionBinSrchTree to insert elements
    of text. The method LinesWordInBinSrchTree traverses the Binary search tree inorder and displays the
    words with the lines in which each appears.
    >>>>>>>>>>>>>>>>>>>>>>
    //InsertionBinTree is of type BinSearchTreeWordNode
    BinSrchTreeWordNode InsertionBinSrchTree(String w, int line,                                             BinSrchTreeWordNode bst)
    //First a check must be made to make sure that we are not trying to //insert a word into an empty tree. If tree is empty we just create a //new node.
         If (bst == NULL)
                   System.out.println(“Tree was empty”)
         For (int rows =0; rows <= 6; rows++)
                   For (int cols = 0; cols <= 4; cols++)
                        Textcont[i][j] = w

    What is the purpose of this thread? You are yet to ask a question... Such a waste of time...
    For future reference use CODE TAGS when posting code in a thread.
    But again have a think about how to convey a question to others instead of blabbering on about nothing.
    i think it does not get any harder than this.What is so difficult to understand. Google an implementation of a binary tree using a single array. Then you can integrate this into the required 2-dimension array for your linked list implemented as an array in your 2-d array.
    Mel

  • Searching a binary search tree  written to a file

    hello
    I have a binary search tree which has 10 levels. Now I want to search a node
    after writing all the nodes to a file.
    Can anyone help me in doing this. A sample code would be great ...
    Thanks
    K

    You suggest that I do away with the inner class
    then?Absolutely. In fact I strongly suggest this. You are learning how to code and need to do things cleanly and in small steps. That means first creating your Node class and making sure it works. Then creating your Tree class, and making sure it works. In fact I would load the Strings into the Tree class first directly and testing things before even thinking about reading to and from files. Only then should you implement the file input and output steps.
    The key here is that you don't go on to the next step until you're reasonably sure that your current code works. Remember, it's MUCH easier to code than to debug.

Maybe you are looking for

  • Provisioning problem for AD and SAP ABAP Systems

    Hi, We're using IDM 7.20 SP3 and successfully run he Initial Load for AD, NW 7.30 and ERP 6.0 Systems successfully. But, when I add the priviledge of systems to a new user created via IDM UI, It is not provisioned successfully. Job Log show the follo

  • How to block emails with specific sender name?

    I find some of the spam emails has a common sender name, but the sender email address is random. How to create an Outlook rule to block such emails? It seems Outlook rule can only blocks emails based on sender email address, not the sender name. Also

  • Why is iDVD compressing images in my menu template?

    Hi All I am compiling a movie in iDVD ver 6.0.3 on Mac Pro using the "Lines" template from 5.0 Themes for my DVD menu. This template let's you drop in some photos that scroll across the screen. So, I dragged & dropped some high resolution images into

  • Hp Support.... Does it exist? Not for me....

    Nov 25th - Purchase of HP Touch Smart system (Christmas gift for my Wife and Kids) Dec 1st - System Crashs. Restore. Crashs again, Take system back to place of purchase to find none left. They send it off to HP to be "looked at" Dec 17th System retur

  • PHYSICAL FILES FOR ABAP PROGRAM

    hi friends i would like to know are there any physical files on os level for the ABAP programs.for example, when we create a customized report for sales in ABAP does SAP also create a corresponding copy on os level. if yes then in which file system .