Help AVL Tree in JAVA code (remove) question-answer

Hi,
everyone. I have question.
I want codes in Java for AVL Tree.
I but must have remove methods or choose elements.
It`s main for me.
If you know, please write in code JAVA or contact e-mail.
or link to page or if you have self code.
thanks,
regards
[email protected]

I have a better idea.
Why don't you try to do it yourself, and when you get stuck, post your code and details of what difficulty you're having.
When you post code, please use[code] and [/code] tags as described in Formatting tips on the message entry page. It makes it much easier to read.

Similar Messages

  • Populate Flex Tree from Java Code (Database)

    Hi
    Can someone please help me? I'm very new to using flex. I'm
    basically trying to create a tree that is populated from data in my
    database. I am using hibernate to fetch that data.
    The plan is to basically create the tree in Java code (since
    I don't want any processing done on the client PC) and then pass
    this to the flex tree (or an actionscript data structure that is
    compatible as the tree datasource)
    I am creating the java tree using DocumentImpl. Is this
    correct? What class would work?
    Element e = null;
    Node n = null;
    Document xmldoc= new DocumentImpl();
    Element root = xmldoc.createElement("USERS");

    quote:
    Originally posted by:
    ntsiii
    Stop running and get a map (read the documents)
    This is hardly a useful comment and must discourage new users
    from asking questions. If you think the documentation relating to
    the use of the tree control is straightforward then I beg to
    differ.
    If you are aware of a clear example of how to use the data
    tree with a php backend returning a remote data object please
    enlighten me. Meanwhile I continue my search but not within the
    livedocs.
    One site I have found that may be of use is
    http://flexdiary.blogspot.com/2009/01/lazy-loading-tree-example-file-posted.html
    Not everyone is an expert.

  • How doest jdk docs help as in writing java code?

    hi i wonder how does jdk docs help as in writing java code because if i google a java code the jdk docs always becomes the result of my search but in my experience jdk docs never helps me.
    is there any one know how to use jdk docs? and how to get the code from there.
    im telling about jdk docs from here http://download.oracle.com/javase/1.4.2/docs/api/
    cross posted from http://www.thenewboston.com/forum/viewtopic.php?f=119&t=13778
    Edited by: 871484 on Jul 18, 2011 4:18 PM

    871484 wrote:
    ok can any one give me example how to use jdk docs? for example this code
    Your question still does not make any sense, and you still haven't clarified what you're not understanding.
    However, if you think that just by reading the API docs, with no other training or study, that you will be able to write that code, then you are seriously misunderstanding the purpose of the docs.
    Obviously English is not your native language. You grew up speaking some other language at home and with your friends, and at some point in school or as private study, you started to learn English. You learned about the grammar and the alphabet and pronunciation, sentence structure, word order, etc. Now you have the basics of how the language works, and you know some words. When you want to learn new words to fit into the structure you have learned, you use a dictionary.
    If you didn't study the grammar, sentence structure, etc., and just said, "I want to learn English. I will look at a dicationary," clearly that would not work.
    Right?
    So, since you now understand and agree with the English example, let me state something that I hope is obvious to you by now: The API docs are your dictionary. They are not a substitute for learning the language basics.
    Furthermore, once you know the language basics in English and have your dictionary, you still won't know how to write a resume (which you may know as a CV). You will look at examples and perhaps take a course on resume (CV) writing. Just reading a dictionary won't help you write a resume(CV). Similarly, if you know some Java basics, you can't learn how to write a Swing app just by reading the Javadocs. You'll look at tutorials and examples. Then, once you know the basic structure of a Swing app, you'll look to the javadocs for more details about more kinds of GUI classes--different buttons and windows and panes and panels and layout managers, etc.

  • Could you help please ? I forgot my security questions answer

    Hello to evewryone ! Could you help please ? I forgot my security questions answers !

    The Apple Support Communities are an international user to user technical support forum. As a man from Mexico, Spanish is my native tongue. I do not speak English very well, however, I do write in English with the aid of the Mac OS X spelling and grammar checks. I also live in a culture perhaps very very different from your own. When offering advice in the ASC, my comments are not meant to be anything more than helpful and certainly not to be taken as insults.
    It is suggested that you contact Itunes Customer Support and ask that they transfer your issue to the Account Security Team to reset the questions so that you may configure them again.
    iTunes Support -
    http://www.apple.com/support/itunes/

  • Who can help me write this Java code show the prime number ???? PLEASEEEEEE

    Write java code print prime number like this
    Sample Screen Print:
    Initial matrix with N = 37
    2 3 4 5 6 7 8 9 10
    11 12 13 14 15 16 17 18 19 20
    21 22 23 24 25 26 27 28 29 30
    31 32 33 34 35 36 37
    Intermediate results (after 1st iteration)
    2 3 5 7 9
    11 13 15 17 19
    21 23 25 27 29
    31 33 35 37
    Intermediate results (after 2nd iteration)
    2 3 5 7
    11 13 17 19
    23 25 29
    31 35 37
    Intermediate results (after 7th iteration)
    2 3 5 7
    11 13 17 19
    23 29
    31 37
    Final results
    2 3 5 7 11 13 17 19 23 29
    31 37
    How to write this code ?
    Please Help me!
    Thank you so muchhh ?????

    h2. {color:#ff0000}Multiplepost{color}
    Replies here: http://forum.java.sun.com/thread.jspa?threadID=5241012&tstart=0
    There is a useful answer the original thread. Answer it, or ignore it as you like, but don't create multiple threads.

  • Can anybody help me produce a Java code??? HELP GREATLY APPRECIATED!!!

    This is the goal:
    Write a program that produces block letters for the following letters which could be read into your program: A, B, C, E, F, G, H, I, L, O, P, T, or U.
    The user should input ONE letter from the keyboard. The user should also input a width as an integer to determine the width of the letters. This input should be at least 5 and up to 20; if the user enters less than 5 or more than 20, issue an error message for the user and quit the program.
    Replies are gratly appreciated!!!

    jk89computer wrote:
    To add to my original topic,
    My question is can anybody produce a java program that can do the following:
    Write a program that produces block letters for the following letters which could be read into your program: A, B, C, E, F, G, H, I, L, O, P, T, or U.
    The user should input ONE letter from the keyboard. The user should also input a width as an integer to determine the width of the letters. This input should be at least 5 and up to 20; if the user enters less than 5 or more than 20, issue an error message for the user and quit the program.
    For example, the letter A would be formed by:
    * *Thank you for adding more complete requirements for us to do your homework for you. We'll get right on that. Donuts are on the table, help yourself to them while you wait.

  • Help with Trees in java!

    I have an assignment to create a bouncing ball, with collision detection, and obstacles, and to also include trees.
    I have managed to get a bouncing ball(using awt graphics), but I am having problems with the tree, as i do understand that the dimensions for my canvas/boundary area for my ball will be the root node, and for each of my child node, will be the grid with my obstacle in it(the data in it will be the coordinates for each grid
    However, I still don't know what to do as I can easily explain a program, but i cant put it into programming sense, so if anyone knows exactly how to code a tree program to include my grid layouts, and my bouncing ball..........
    N.B I am not sure if i really pointed out what the problem is, however if you need me 2 post my code up, or explain myself further, I will be very happy to do that.
    I also need help on how to create the grid(not sure if i need one), i am soo confused!!
    Thanks for any help in advance
    Message was edited by:
    tawa
    Message was edited by:
    tawa

    I can easily explain a programReally? But can you explain it in such a way that somebody else understands your explanation? If so, then this would be a good time to do that.
    For example I don't understand what trees have to do with your description. The best guess that I can make is that they are some kind of vegetation that gets in the way of your bouncing balls.

  • JDev 10.1.2 ADF UIX - Help required in wrinting java code

    Ok here is wher iam stuck.
    I have used a method which is used to run search form.
    That is the field name to be searched and the value is sent into this method.
    The uix page is a master detail page.
    So from the UIX page the user selects the field and the value, which is then sent to the customised method of mine.
    The method code is as given below.
    public final void setCourseRegistrationSearch(String p_field, String p_value)
    ViewObject REGDETAILVO=findViewObject("RegistrationDetailView4");
    ViewObject REGMASTERVO=findViewObject("RegistrationMasterView1");
    if (p_value.equalsIgnoreCase(""))
    String whereclause="1=1";
    REGDETAILVO.setWhereClause(whereclause);
    REGDETAILVO.executeQuery();
    else
    if( (p_field.equalsIgnoreCase("mod_name")))
    String whereclause="reg_master_id in
    (select reg_master_id from registration_detail where "
    p_field"LIKE '%"+p_value+"%')";
    REGMASTERVO.setWhereClause(whereclause);
    REGMASTERVO.executeQuery();
    if((p_field.equalsIgnoreCase("bt_description")))
    String whereclause= "reg_master_id in
    (select reg_master_id from registration_detail where bt_id in
    (select bt_id from batch_timing where"
    p_field" LIKE '%"+p_value+"%'))";
    REGMASTERVO.setWhereClause(whereclause);;
    REGMASTERVO.executeQuery();
    Now when I use the first if statement where mod_name is filtered it works fine.
    When I use the second option for bt_description its doesn't work.
    The error i get is an oracle error which says missing right parenthesis.
    So I checked through the debugger for the whereclause String.
    There I found that the string gets trimmed to...
    (select reg_master_id from registration_detail where bt_id in
    (select bt_id from b
    hence the error.
    Could someone tell me why this is happening? Is there a workaround method for this?
    Would be of great help.
    Regards,
    Vineet

    Solved it!! :-)
    In the UIX page I check for the proxy in the event result, if it is there I take it, otherwise I take it from bindingcontext. Is this the right way to do it? Here is the UIX code:
                            <hGrid id="pptoHGrid" alternateText="No items were found"
                                   treeData="${bindings.bindingContext['tree']}">
                              <boundAttribute name="proxy">
                                <if>
                                  <comparison type="equals">
                                    <null/>
                                    <dataObject default="${uix.eventResult.hGridProxy}"/>
                                  </comparison>
                                  <dataObject default="${bindings.bindingContext['hGridProxy']}"/>
                                  <dataObject default="${uix.eventResult.hGridProxy}"/>
                                </if>
                              </boundAttribute>Greets,
    Fernando

  • Help me with my java code

    i have an assignment from the book java programming d.s malik.
    problem:
    for research purposes and to assist students, the admissions office of your local university wants to determine the performance of the female and male students in certain courses. You receive a file that contains female and male students' GPAs for certain courses. Due to confidentiality, the letter code f is used for female and m is used for male. every file entry consists of a letter code followed by a GPA. each line has one entry. the number of entries in the file is unknown. write a program that computes and outputs the average gpa for both female and male students. format your result to two decimal places.
    solution:
    this is what i have come up with:
    import java.io.*;
    import java.util.*;
    class Assignment6
         public static void main(String[] args)
                                  throws FileNotFoundException
               String str,
                         gender;
               double counter = 0;
               double counter2 = 0;
               double gpa = 0;
               double sum1, sum2;
               double average1, average2;
               Scanner console = new Scanner(System.in);
               Scanner inFile = new Scanner(new FileReader("gpa.txt"));
               PrintWriter outFile = new PrintWriter("gpa.out");
               gender = inFile.next();
               gpa = inFile.nextDouble();
               while(gender.charAt(0) != 'x')
                    if(gender == 'm')
                        sum1+= gpa;
                       counter = counter + 1.0;
                       average1 = sum1/counter;
                   else if(gender == 'f')
                        sum2+= gpa;
                        counter2 = counter2 + 1.0;
                        average2 = sum2/counter2;
               System.out.println("The count is " + counter);
               System.out.println("The average is = " + average1);
               System.out.println("The count is " + counter2);
               System.out.println("The average is = " + average2);
              outFile.print("There are " + counter + " male students.");
             outFile.printf("Average GPA for male students is: " + average1);
             outFile.print("There are " + counter2 + " female students.");
             outFile.printf("Average GPA for female students is: " + average2);
             outFile.close();
    }and the text file is
    gpa.txt
    m 2.4
    f 3.2
    m 3.7
    m 4.0
    f 2.9
    f 1.8
    f 3.8
    m 1.7
    m 3.4
    f 2.6
    m 2.8
    m 1.7
    f 3.7
    m 3.9
    f 4.0
    f 3.6
    m 2.3
    f 2.9
    m 3.0
    m 2.7
    x
    question:
    i couldn't compile and run it, i get 2 errors:
    M:\School\CSCI - 111 - Classwork\Assignments\Java1\Assignment6.java:29: incomparable types: java.lang.String and char
                   if(gender == 'm')
                   ^
    M:\School\CSCI - 111 - Classwork\Assignments\Java1\Assignment6.java:35: incomparable types: java.lang.String and char
                   else if(gender == 'f')
    thanks

    okay i did everything, but i still couldn't get it to work. i wonder if im using a wrong solution. or is there anything i didn't know before even proceeding into this?
    update:
    import java.io.*;
    import java.util.*;
    class Assignment6
         public static void main(String[] args)
                                  throws FileNotFoundException
               String str,
                        gender;
               double cntMale = 0;
               double cntFemale = 0;
               double gpa = 0;
               double sumMale = 0, sumFemale = 0;
               double avgMale = 0, avgFemale = 0;
               Scanner console = new Scanner(System.in);
               Scanner inFile = new Scanner(new FileReader("gpa.txt"));
               PrintWriter outFile = new PrintWriter("gpa.out");
               gender = inFile.next();
               gpa = inFile.nextDouble();
               while(gender.charAt(0) != 'x')
                    if(gender.charAt(0) == 'm')
                        sumMale+= gpa;
                       cntMale = cntMale + 1.0;
                   else if(gender.charAt(0) == 'f')
                        sumFemale+= gpa;
                        cntFemale = cntFemale + 1.0;
              avgMale = sumMale/cntMale;
              avgFemale = sumFemale/cntFemale;
               System.out.println("The count is " + cntMale);
               System.out.println("The average is = " + avgMale);
               System.out.println("The count is " + cntFemale);
               System.out.println("The average is = " + avgFemale);
              outFile.print("There are " + cntMale + " male students.");
             outFile.printf("Average GPA for male students is: " + avgMale);
             outFile.print("There are " + cntFemale + " female students.");
             outFile.printf("Average GPA for female students is: " + avgFemale);
              inFile.close();
             outFile.close();
    }Edited by: spkenn5 on Nov 9, 2008 4:31 PM

  • Help required in compiling Java Code.

    I have java1.6 installed on my PC but I want to compile my code in such a way that
    it will run on PCs with lower versions of java installed.
    I am not using any feature specific to java1.6 in my program.
    I am using Netbeans IDE 6.1
    Thanks in advance.

    calypso wrote:
    Im not 100% sure of this but I would of thought a program will compile on any version of java as long as you dont use classes that are exclusive to higher version of java
    for example i would think if you comiled the helloworld tutorial on v.1.6 it will run on computers with lower versions.
    However a program which uses the scanner class (i think exclusive to 1.6 or 1.5 not sure though) will not run on say 1.2
    CalypsoIve tested to run an complied class(version 1.6) on an computer with jre 1.5 installed(before), and it doesnt work. Dont remember precisly the error but it didnt run atleast.

  • Please help me whit this java code

    Hi!
    I have a litle problem whit this question:
    I try to write a program about Salary. The user writes(puts in from keyboard)
    the workers name, hourePayment and hour(how many hours He has worked).
    The program must compute first week ,second week....fourth week
    The user writes just one time name and hourPayment,
    but he must write hours(total hours he has worked)
    for every week(may be ha has worked 30 hours first week and 40 hours second week.....).
    when the user puts in zero the program stops(while(hour!=0)).
    I wrote the program but I have problem whit
    Test class when the program computes first ,second and...weeks, and if the user don not put in zero the program must compute another persons salary
    we should give new name new houre payement....
    how do I use the same information for second person and computes his salary.
    class Salary{
    private String name;
    private double hourPayment;
    public Salary (String name, double hourPayment, ..){
    this.name= name;
    this.hourPayment=hourPayment;
    public String getNamn(){
    return name;}
    public double getHourPayment(){
    return hourPayment;
    public double compute(int time){
    if(time<=40){
    normalSalary =(hourPayment*time);}
    else if(time>40){
    ....=(((40*hourPayment)+(time-40)*(3/2)*hourPayment));
    else if(timmar>70){
    System.out.println("WARRNING:"+" "+"You have worked more than 30

    The code you wrote only computes one week's salary. You need to wrap that inside loops that collect names, rates and hours. Here's some pseudocode to get you started:
    get name
    while name NOT ""
        get rate
        for i = 1 to 4
            get hours worked
            compute pay // this is the part you've coded
        next i
        get name
    end while

  • Please help to write a java code for generate Random numbers

    I need a program for generate Random integer numbers by using roulette wheel theory. I search several ares, but I'm unable to find out at lease a Pseudo code for implement this. If you know or have a code for this, Please send me a mail to [email protected] or post here.

    Gagana wrote:
    I need a program for generate Random integer numbers Have a look at the java.util.Random class:
    [http://java.sun.com/j2se/1.5.0/docs/api/java/util/Random.html]
    Or Google:
    [http://www.google.com/search?q=random+java]
    by using roulette wheel theory. What is that?
    ... Please send me a mail to [email protected]
    No, that defeats the purpose of a public forum. And no one is going to e-mail you (other than someone trying to sell V1AGRA).

  • How to get the selected node value of a tree which is build on java code

    Hi Experts,
    How can i get the selected node value if I build the tree programatically.
    I am using the following code in selectionListener but it is throwing error.
    RichTreeTable treeTable = (RichTreeTable)getQaReasontreeTable();
    CollectionModel _tableModel =
    (CollectionModel)treeTable.getValue();
    RowKeySet _selectedRowData = treeTable.getSelectedRowKeys();
    Iterator rksIterator = _selectedRowData.iterator();
    String selectedQaCode ="";
    while (rksIterator.hasNext()) {
    List key = (List)rksIterator.next();
    JUCtrlHierBinding treeTableBinding =
    (JUCtrlHierBinding)((CollectionModel)treeTable.getValue()).getWrappedData();
    JUCtrlHierNodeBinding nodeBinding =
    treeTableBinding.findNodeByKeyPath(key);
    String nodeStuctureDefname =
    nodeBinding.getHierTypeBinding().getStructureDefName();
    selectedQaCode = selectedQaCode + nodeBinding.getAttribute(0);
    where I am using following link to create a tree with java code.
    http://one-size-doesnt-fit-all.blogspot.com/2007/05/back-to-programming-programmatic-adf.html
    Please help me in resolving this issue.
    Regards
    Gayaz

    Hi,
    you should also move
    JUCtrlHierBinding treeTableBinding =
    (JUCtrlHierBinding)((CollectionModel)treeTable.getValue()).getWrappedData();
    out of the while loop as this is not necessary to be repeated for each key in the set
    Frank

  • Run chm help file through java code

    hello,
    would you tell me how can i run a help.chm file using java code. i am trign this but no luck.
    first try
    Process pp=run.exec("C:/Program Files/Internet Explorer/IEXPLORE.exe ./res/bobftphelp.chm" );
    Second try
              Process pp=run.exec(" ./res/bobftphelp.chm" );
    It run fine a help.doc file but not help.chm file.
    please help me
    Thanka in advance
    Ravi Charan

    The second address given to that function, does it relate to the class that its being called from? cause i've got
    Runtime.getRuntime().exec("C:\\WINDOWS\\hh.exe .\\HelpFile_9_3.chm" );where HelpFile_9_3 is in the same folder as my class, but it won't work. Can anyone help?
    Also, can you search within a chm file from Java? If I get that above code working, I presume it'll open the help file to the main page. I'd like to search within that document for a word or phrase - possible?
    Thanks!
    Edited by: Pulkse.co.uk on Sep 10, 2008 8:18 AM

  • Where to Place Custom Java Code

    We are planning on adding customized Java code to Identity Manager 8; XPRESS will be used to call the customized Java code.
    Questions:
    1) Where does this customised code reside in the Java Application Server (Glassfish)?
    2) Does the customized Java code have to be packaged in a JAR file?
    Many thanks for your help.

    You would deploy custom Java code along with the IDM war/ear file. Classes go in the WEB-INF/classes/ folder, JARs in WEB-INF/lib/ and that is application server independant.
    Class files or JARs? Do you have any build process for your IDM, like the custom build environment CBE, then the source files might end up as class files; if you are using a seperate build environment for those custom classes, then packaging them in a JAR would be the way to go.
    Generally speaking, using a JAR for your custom code is neater; whether a class in classes/com/foo/bar/Foo.class or in lib/myfoobars.jar takes precedence over the other is up to the class loader and depending on your application server and its settings, the behavior might vary - so be careful about mixing use of those locations.

Maybe you are looking for