Implementation of a parse tree in Java (Urgent)

How best can a parse tree be implemented in java, i have read some online information that suggest use of data structures, but i am still not clear on how to do it.

Well, you need a tree. A logical way to structure a tree is out of "node" objects. A node presumeably will hold some data, and may also have one or more subnodes.
So the root of your effort ought to go into designing the node - data it will hold, and getters and setters, and operations to walk the tree.

Similar Messages

  • Implementation of a parse tree in java (HELP!!!)

    I want to be able to do this in java, please how can i implement this.
         +
              a *
              b c

    It's not entirely clear what you want to do. That expression in infix notation (standard notation) would be "(b a c) + *" which doesn't make any sense. The leaves of the tree should be values, and non-leaf nodes should be operators. You can implement this by using a tree datatype in Java.

  • Binary Tree in Java - ******URGENT********

    HI,
    i want to represent a binary tree in java. is there any way of doing that.
    thanx
    sraphson

    HI,
    i want to represent a binary tree in java. is there
    e any way of doing that.
    thanx
    sraphsonFirst, what is a binary tree? Do you know how the binary tree looks like on puesdo code? How about a representation in terms of numbers? What is a tree? What is binary? The reason I ask is, what do you know about programming?
    Asking to represent a binary tree in java seems like a question who doesn't know how it looks like in the first please. Believe me, I am one of them. I am not at this level yet. If you are taking a class that is teaching binary trees and you don't know how it looks like, go back to your notes.
    Sounds harsh, but it is better to hear it from a person that doesn't know either then a boss that hired you because Computer Science was what you degree said. Yet, you don't know how to program?
    Telling you will not help you learn. I can show you tutorials of trees would be start on where to learn.
    HOW TO USE TREES (oops this is too simple, but it is a good example)
    http://java.sun.com/docs/books/tutorial/uiswing/components/tree.html
    CS312 Data Structures and Analysis of Algorithms
    (Here is a course about trees. Search and learn)
    http://www.calstatela.edu/faculty/jmiller6/cs312-winter2003/index.htm

  • Implementation of LISP trees in Java

    I have a problem with implementation of a something similar to a LISP tree in Java. That means that I want to be able to combine different if-else-conditions from a set of variables and operators and run it. For example, if (variable) (operator) (variable) (operator2) (variable) (operator) (variable)
    whereby :
    variable: means a variable
    operator: <, >, =, +, _,
    variable: variable
    operator2: &&, ||, etc
    I don't know how to do in a way that a variable can be picked up from a set, operator can be picked up from a set and operator2 can also be picked up from a set.

    Lisp doesn't use trees... it uses lists. In fact, Lisp stands for "List Processing".
    Take a look at the java.util.LinkedList class. If you make a LinkedList of Nodes, where each Node contains an Object car and LinkedList cdr, you've got yourself a Lisp list implementation!

  • How to parse XML to Java object... please help really stuck

    Thank you for reading this email...
    If I have a **DTD** like:
    <!ELEMENT person (name, age)>
    <!ATTLIST person
         id ID #REQUIRED
    >
    <!ELEMENT name ((family, given) | (given, family))>
    <!ELEMENT age (#PCDATA)>
    <!ELEMENT family (#PCDATA)>
    <!ELEMENT given (#PCDATA)>
    the **XML** like:
    <person id="a1">
    <name>
         <family> Yoshi </family>
         <given> Samurai </given>
    </name>
    <age> 21 </age>
    </person>
    **** Could you help me to write a simple parser to parse my DTD and XML to Java object, and how can I use those objects... sorry if the problem is too basic, I am a beginner and very stuck... I am very confuse with SAXParserFactory, SAXParser, ParserAdapter and DOM has its own Factory and Parser, so confuse...
    Thank you for your help, Yo

    Hi, Yo,
    Thank you very much for your help. And I Wish you are there...I'm. And I plan to stay - It's sunny and warm here in Honolulu and the waves are up :)
    A bit more question for dear people:
    In the notes, it's mainly focus on JAXB,
    1. Is that mean JAXB is most popular parser for
    parsing XML into Java object? With me, definitely. There are essentially 3 technologies that allow you to parse XML documents:
    1) "Callbacks" (e.g. SAX in JAXP): You write a class that overrides 3 methods that will be called i) whenever the parser encounters a start tag, ii) an end tag, or iii) PCDATA. Drawback: You have to figure out where the heck in the document hierarchy you are when such a callback happens, because the same method is called on EACH start tag and similarly for the end tag and the PCDATA. You have to create the objects and put them into your own data structure - it's very tedious, but you have complete control. (Well, more or less.)
    2) "Tree" (e.g. DOM in JAXP, or it's better cousin JDOM): You call a parser that in one swoop creates an entire hierarchy that corresponds to the XML document. You don't get called on each tag as with SAX, you just get the root of the resulting tree. Drawback: All the nodes in the tree have the same type! You probably want to know which tags are in the document, don't you? Well, you'll have to traverse the tree and ask each node: What tag do you represent? And what are your attributes? (You get only strings in response even though your attributes often represent numbers.) Unless you want to display the tree - that's a nice application, you can do it as a tree model for JTree -, or otherwise don't care about the individual tags, DOM is not of much help, because you have to keep track where in the tree you are while you traverse it.
    3) Enter JAXB (or Castor, or ...): You give it a grammar of the XML documents you want to parse, or "unmarshall" as the fashion dictates to call it. (Actually the name isn't that bad, because "parsing" focuses on the input text while "unmarshalling" focuses on the objects you get, even though I'd reason that it should be marshalling that converts into objects and unmarshalling that converts objects to something else, and not vice versa but that's just my opinion.) The JAXB compiler creates a bunch of source files each with one (or now more) class(es) (and now interfaces) that correspond to the elements/tags of your grammar. (Now "compiler" is a true jevel of a misnomer, try to explain to students that after they run the "compiler", they still need to compile the sources the "compiler" generated with the real Java compiler!). Ok, you've got these sources compiled. Now you call one single method, unmarshall() and as a result you get the root node of the hierarchy that corresponds to the XML document. Sounds like DOM, but it's much better - the objects in the resulting tree don't have all the same type, but their type depends on the tag they represent. E.g if there is the tag <ball-game> then there will be an object of type myPackage.BallGame in your data structure. It gets better, if there is <score> inside <ball-game> and you have an object ballGame (of type BallGame) that you can simply call ballGame.getScore() and you get an object of type myPackage.Score. In other words, the child tags become properties of the parent object. Even better, the attributes become properties, too, so as far as your program is concerned there is no difference whether the property value was originally a tag or an attribute. On top of that, you can tell in your schema that the property has an int value - or another primitive type (that's like that in 1.0, in the early release you'll have to do it in the additional xjs file). So this is a very natural way to explore the data structure of the XML document. Of course there are drawbacks, but they are minor: daunting complexity and, as a consequence, very steep learning curve, documentation that leaves much to reader's phantasy - read trial and error - (the user's guide is too simplicistic and the examples too primitive, e.g. they don't even tell you how to make a schema where a tag has only attributes) and reference manual that has ~200 pages full of technicalities and you have to look with magnifying glas for the really usefull stuff, huge number of generated classes, some of which you may not need at all (and in 1.0 the number has doubled because each class has an accompanying interface), etc., etc. But overall, all that pales compared to the drastically improved efficiency of the programmer's efforts, i.e. your time. The time you'll spend learning the intricacies is well spent, you'll learn it once and then it will shorten your programming time all the time you use it. It's like C and Java, Java is order of magnitude more complex, but you'd probably never be sorry you gave up C.
    Of course the above essay leaves out lots and lots of detail, but I think that it touches the most important points.
    A word about JAXB 1.0 vs. Early Release (EA) version. If you have time, definitively learn 1.0, they are quite different and the main advantage is that the schema combines all the info that you had to formulate in the DTD and in the xjs file when using the EA version. I suggested EA was because you had a DTD already, but in retrospect, you better start from scratch with 1.0. The concepts in 1.0 are here to stay and once your surmounted the learning curve, you'll be glad that you don't have to switch concepts.
    When parser job is done,
    what kind of Java Object we will get? (String,
    InputStream or ...)See above, typically it's an object whose type is defined as a class (and interface in 1.0) within the sources that JABX generates. Or it can be a String or one of the primitive types - you tell the "compiler" in the schema (xjs file in EA) what you want!
    2. If we want to use JAXB, we have to contain a
    XJS-file? Something like:In EA, yes. In 1.0 no - it's all in the schema.
    I am very new to XML, is there any simpler way to get
    around them? It has already take me 4 days to find a
    simple parser which give it XML and DTD, then return
    to me Java objects ... I mean if that kind of parser
    exists....It'll take you probably magnitude longer that that to get really familiar with JAXB, but believe me it's worth it. You'll save countless days if not weeks once you'll start developing serious software with it. How long did it take you to learn Java and it's main APIs? You'll either invest the time learning how to use the software others have written, or you invest it writing it yourself. I'll take the former any time. But it's only my opinion...
    Jan

  • [svn] 1648: This checkin makes public our modifications to Velocity 1. 4 which make the parse tree serializable.

    Revision: 1648
    Author: [email protected]
    Date: 2008-05-09 14:24:44 -0700 (Fri, 09 May 2008)
    Log Message:
    This checkin makes public our modifications to Velocity 1.4 which make the parse tree serializable.
    Velocity has a slow parser and template lookup mechanism so we save 25% time in the MXML compiler by only using merge at runtime and loading a serialized form of the parse tree from the classpath.
    There's a simple class flex.util.SerializedTemplateFactory that has a main method to serialize a template and a load method to load a template.
    Another significant change is that macros and their arguments are not parsed at runtime; we parse them once at parse time and they are just evaluated at runtime. The original Velocity liked to concatenate tokens in its production rules and then re-parse at runtime.
    It turns out that re-serializing the parse trees is still pretty expensive, so the next step would be to codegen a Java class that does all the velocity actions without any of the Velocity runtime necessary.
    Bugs: -
    QA: No
    Doc: No
    Reviewer: Jono
    Modified Paths:
    flex/sdk/trunk/modules/thirdparty/velocity/src/java/org/apache/velocity/app/VelocityEngin e.java
    flex/sdk/trunk/modules/thirdparty/velocity/src/java/org/apache/velocity/runtime/Runtime.j ava
    flex/sdk/trunk/modules/thirdparty/velocity/src/java/org/apache/velocity/runtime/RuntimeCo nstants.java
    flex/sdk/trunk/modules/thirdparty/velocity/src/java/org/apache/velocity/runtime/RuntimeIn stance.java
    flex/sdk/trunk/modules/thirdparty/velocity/src/java/org/apache/velocity/runtime/RuntimeSe rvices.java
    flex/sdk/trunk/modules/thirdparty/velocity/src/java/org/apache/velocity/runtime/RuntimeSi ngleton.java
    flex/sdk/trunk/modules/thirdparty/velocity/src/java/org/apache/velocity/runtime/Velocimac roFactory.java
    flex/sdk/trunk/modules/thirdparty/velocity/src/java/org/apache/velocity/runtime/Velocimac roManager.java
    flex/sdk/trunk/modules/thirdparty/velocity/src/java/org/apache/velocity/runtime/directive /Foreach.java
    flex/sdk/trunk/modules/thirdparty/velocity/src/java/org/apache/velocity/runtime/directive /Include.java
    flex/sdk/trunk/modules/thirdparty/velocity/src/java/org/apache/velocity/runtime/directive /Macro.java
    flex/sdk/trunk/modules/thirdparty/velocity/src/java/org/apache/velocity/runtime/directive /VMProxyArg.java
    flex/sdk/trunk/modules/thirdparty/velocity/src/java/org/apache/velocity/runtime/directive /VelocimacroProxy.java
    flex/sdk/trunk/modules/thirdparty/velocity/src/java/org/apache/velocity/runtime/parser/Pa rser.java
    flex/sdk/trunk/modules/thirdparty/velocity/src/java/org/apache/velocity/runtime/parser/Pa rser.jj
    flex/sdk/trunk/modules/thirdparty/velocity/src/java/org/apache/velocity/runtime/parser/Pa rser.jjt
    flex/sdk/trunk/modules/thirdparty/velocity/src/java/org/apache/velocity/runtime/parser/To ken.java
    flex/sdk/trunk/modules/thirdparty/velocity/src/java/org/apache/velocity/runtime/parser/bu ild
    flex/sdk/trunk/modules/thirdparty/velocity/src/java/org/apache/velocity/runtime/parser/no de/ASTComment.java
    flex/sdk/trunk/modules/thirdparty/velocity/src/java/org/apache/velocity/runtime/parser/no de/ASTDirective.java
    flex/sdk/trunk/modules/thirdparty/velocity/src/java/org/apache/velocity/runtime/parser/no de/ASTEscape.java
    flex/sdk/trunk/modules/thirdparty/velocity/src/java/org/apache/velocity/runtime/parser/no de/ASTEscapedDirective.java
    flex/sdk/trunk/modules/thirdparty/velocity/src/java/org/apache/velocity/runtime/parser/no de/ASTIdentifier.java
    flex/sdk/trunk/modules/thirdparty/velocity/src/java/org/apache/velocity/runtime/parser/no de/ASTMethod.java
    flex/sdk/trunk/modules/thirdparty/velocity/src/java/org/apache/velocity/runtime/parser/no de/ASTNumberLiteral.java
    flex/sdk/trunk/modules/thirdparty/velocity/src/java/org/apache/velocity/runtime/parser/no de/ASTReference.java
    flex/sdk/trunk/modules/thirdparty/velocity/src/java/org/apache/velocity/runtime/parser/no de/ASTSetDirective.java
    flex/sdk/trunk/modules/thirdparty/velocity/src/java/org/apache/velocity/runtime/parser/no de/ASTStringLiteral.java
    flex/sdk/trunk/modules/thirdparty/velocity/src/java/org/apache/velocity/runtime/parser/no de/ASTText.java
    flex/sdk/trunk/modules/thirdparty/velocity/src/java/org/apache/velocity/runtime/parser/no de/ASTWord.java
    flex/sdk/trunk/modules/thirdparty/velocity/src/java/org/apache/velocity/runtime/parser/no de/Node.java
    flex/sdk/trunk/modules/thirdparty/velocity/src/java/org/apache/velocity/runtime/parser/no de/SimpleNode.java
    flex/sdk/trunk/modules/thirdparty/velocity/src/java/org/apache/velocity/util/introspectio n/Info.java
    Added Paths:
    flex/sdk/trunk/modules/thirdparty/velocity/src/java/flex/
    flex/sdk/trunk/modules/thirdparty/velocity/src/java/flex/util/
    flex/sdk/trunk/modules/thirdparty/velocity/src/java/flex/util/SerializedTemplateFactory.j ava

    Dave,
    First of all, THANK YOU! THis is extremely timely and helpful; exactly what I've been looking for.
    I'm with you all the way until the end, right here:
    wrap the elements into the required delimiters.
    my $returnValue = sprintf('"%s" <%s> (%s) [%s]', $displayName, $emailAddress, $username, $userIdentifier);
    return ETC, ETC
    Did this part lose some formatting in the post? Where are the line breaks? Is it one unbroken string?
    Dual 2GHz G5   Mac OS X (10.4.6)  
    Dual 2GHz G5   Mac OS X (10.4.6)  
    Dual 2GHz G5   Mac OS X (10.4.6)  

  • 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

  • Binary trees in Java

    Hi there
    Do you have any suggestions about how to implement trees or binary trees in Java?
    As far as I know there are already some libraries for that, but I don't know how to use them. Was trying to get some implementation examples but I'm still very confused.
    How can I use for example:
    removeChild(Tree t)
    addChild(Tree t)
    isLeaf()
    Thanks in advance

    Lulu wrote:
    Hi there
    I have several questions about binary trees
    Let's see, I use TreeMap to create them with the following code:
    TreeMap treeMap = new TreeMap<Integer, String>();
    treeMap.put("first", "Fruit");
    treeMap.put("second","Orange");
    treeMap.put("third", "Banana");
    treeMap.put("fourth", "Apple");You've defined the map to hold integer keys and strings as values, yet you're trying to add string keys and string values to it: that won't work.
    If this is a map how do I define if the data should go to the left or to the right of certain node?That is all done for you. In a TreeMap (using the no-args constructor), you can only store objects that are comparable to each other (so, they must implement the Comparable interface!). So the dirty work of deciding if the entry should be stored, or traversed, into the left or right subtree of a node, is all done behind the scenes.
    Also note that TreeMap is not backed up by a binary tree, or a binary search tree, but by a red-black tree. A red-black tree is a self balancing binary tree structure.
    Should I have dynamical keys so that they increase automatically when adding new data?
    According to a webpage I should use Comparator(), is that to find the data in the tree and retrieve the key?
    ThanksI am not sure what it is you want. I am under the impression that you have to write a binary tree (or a binary search tree) for a course for school/university. Is that correct? If so, then I don't think you're permitted to use a TreeMap, but you'll have to write your own classes.

  • BI-IP implementation in BI 7.0(NUC)+ Java Add-In(UC) system

    Hi Experts,
    We want to implement BI-IP in our existing SAP BI 7.0 system which we upgraded from BW 3.5 to BI 7.0 followed by adding the Java Add-In. During the installation of the Java Add-In central instance the BI-Java, EP Core & EP software units were selected as well, so technically this system has all the components needed for the BI-IP implementation i.e BI(ABAP), AS Java/EP/EPC, BI(Java), the question or concern now raised is
    "As we know BI 7.0 is a non-unicode setup, while Java Add -In is a unicode setup", will a combination of the unicode & non-unicode in the same BI server be able to be utilized for the BI-IP implementation purpose?, does SAP support such combination?.
    Please advice if the BI-JAVA & BI-ABAP installed in the same BI7.0 system utilizing unicode & non-unicode kernel will work for the BI-IP implementation just like it works under scenario where BI-JAVA, EP, EPC are running under the EP7.0 system & BI-ABAP is running in the BI7.0 system.
    Find attached some info on the BI, ECC6 & EP systems.
    ECC6: It was upgraded from R3 4.6C to ECC6, It's on AIX 5.2, Oracle 10.2 & Kernel is Non- Unicode
    EP 7.0: It was upgraded from EP 6.0 to 7.0. It's on AIX 5.2, Oracle 10.2 & Kernel is Unicode
    BI 7.0: It was upgraded from BW 3.5 to BI 7.0 with Java Add-In installed later, It's on AIX 5.2, Oracle 10.2, ABAP kernel is Non-Unicode, Java kernel is Unicode
    Thanks & Rgds,
    Abhishek

    I'm in exactly the same boat.
    BI Publisher is a COM Add-In... Clicking the GO... with COM Add-In selected gives me an unselected BI Publisher Template Builder for Word and the following statement for Load Behavior:
         Not Loaded. A runtime error occurred during the loading of the COM Add-in.
    Any thoughts?
    Thanks,
    Rich

  • 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.

  • Creating non binary trees in Java

    Hi everybody actually i am used in creating binary trees in java,can u please tell me how do we create non binary -trees in java.

    Hi,
    Can u let us know the application area for Non binary tree.
    S Rudra

  • Non binary trees in java

    Hi guys i am used in creating binary trees ,tell me how do we create non binary trees in java.

    public class Node {
      private final Object payload;
      private final Set<Node> children;
      public Node(Object payload) {
        this.payload = payload;
        children = new HashSet<Node>();
      // now add methods to add/remove children, a method to do something with the payload (say,
      // a protected method that passes the payload to a method specified by some kind of interface),
      // and methods to recurse over children.
    }Actually rather than using Object probably should have generic-ized the class, but whatever.

  • Can I use a C/C++ xml parser in my java program?

    Hi,
    How can I use a C/C++ xml parser in my java program?
    Elvis.

    You would still need to convert the XML data structure into a Java data structure to import it into Java.
    Don't assume you need C++ to do anything. I woudl write it in Java first, then profile the application to see where the bottle necks are and then optimise them
    Don't optimise code unless you have proof it needs to be optimised.
    If you want to improve the speed of reading XML, try XMLbooster

  • Is parser provided by java validating??

    I have jdk 1.4 on my machine and was wondering if the parser provided is a validating parser?
    I ran a program with an XML file, using a DTD for validation, that had text in an element that was declared as EMPTY. I didnt get any errors. I was expecting them. Can anyone explain why this is happening?
    Also is there any advantage of using the Apache xerces parser over the parser provided by java.
    thanks in advance

    have you setValidating(true) on your DocumentBuilderFactory?

  • Tutorials to implement Flash Islands with Web Dynpro Java

    Hi,
    We have downloaded the CE 7.1 EhP1 trial version.
    Any pointers to tutorials to implement Flash Islands with Web Dynpro Java would be helpful.
    Thanks,
    Chitrali

    Hi,
      I read a document which says Adobe Flex Builder is not been included part of shipment of NW. So not lots of documents available. Yet with WDA, some tutorials and blogs are available. Similar application can be developed using WDJ. Please check these.
    WDJ:
    The specified item was not found.
    WDA:
    http://www.adobe.com/devnet/sap/
    https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/10989ef6-968c-2b10-50a9-eb34a5267163
    https://www.sdn.sap.com/irj/scn/wiki?path=/display/emtech/sapRichIslandsforAdobe+Flash
    Regards,
    Harini S

Maybe you are looking for

  • File association with JWS and windows

    Hi, We are moving all our applications over to JWS from install anywhere. One final hurdle we have is the requirement to associate a file extension with a given JWS application. e.g a double clicking a .foo file will launch JWS application MYJWSFooAp

  • Setting Photoshop CC as default

    Since installing Mac OS 10.9 and Photoshop CC, my .psd files do not want to open with Photoshop CC. If I open the "Get Info" window on a .psd file, I can set "Open with" to Adobe Photoshop CC for an individual file, but if I click "Change All" and cl

  • Queue a dynamic container type

    Hi, I have several threads running, each waiting for an input queue (queue names are numbered  by threads: "Queue0", "Queue1", ...) and expecting an individual container type as input in the queue. I have variables for all these input containers, als

  • My iPhone's notification center and command center aren't coming up

    My iPhone's notification and command centers aren't coming up. It works when I restart the iPhone, but after a while they won't work.

  • Need some help scripting a specific menu animation, please

    I have this Actioscript 2 file here (see attached). I have the animation performing ok in the file, but I am having trouble getting the movie clip to play on mouseover.  I could really use some advice on this...  I've been through a number of tutoria