Search:

Type: Posts; User: javapenguin

Search: Search took 0.11 seconds.

  1. Replies
    28
    Views
    2,963

    Re: Is this allowed?

    Well, I took most of it.

    In fact, I likely took pretty much all of it.

    It's been updated as you can see.

    In the other thread.
  2. Replies
    28
    Views
    2,963

    Re: Is this allowed?

    I'm having a very hard time trying to figure out what he wants me to do with those tokens.

    And how to evaluate the expressions.

    I continue to update and I feel like I'm talking to a brick...
  3. Replies
    28
    Views
    2,963

    Re: Is this allowed?

    public abstract class Node
    {

    protected Node left, right, parent;
    protected Object data;
    protected ArrayList<Object> childrenHolder;

    public Node(Object data, Node parent, Node left, Node ...
  4. Replies
    28
    Views
    2,963

    Re: Is this allowed?

    Ok, I'm thinking that perhaps for a + b * c

    I do something like this:

    OperandStack.push('+');
    OperandStack.push('*');

    OperatorStack.push(a);
    OperatorStack.push(b);
    OperatorStack.push(c);
  5. Replies
    28
    Views
    2,963

    Re: Is this allowed?

    PDF was updated.

    https://blackboard.ilstu.edu/webct/urw/lc764539604011.tp764539626011/RelativeResourceManager/sfsid/857411743031
  6. Replies
    28
    Views
    2,963

    Re: Is this allowed?

    public abstract class Node
    {

    protected Node left, right, parent;
    protected Object data;
    protected ArrayList<Object> childrenHolder;

    public Node(Object data, Node parent, Node left, Node ...
  7. Replies
    28
    Views
    2,963

    Re: Is this allowed?

    I have this, but I don't know how to make the OperatorNode class evaluate the expressions.


    public class BST<T extends Comparable<T>>
    {
    private class Node<T>
    {
    private T data;
    private...
  8. Replies
    28
    Views
    2,963

    Re: Is this allowed?

    Hey, is it legal to have switch structures within switch structures

    c =this.getData();
    switch(c)
    {

    case( ' ( ' )

    bla bla bla;
  9. Replies
    28
    Views
    2,963

    Re: Is this allowed?

    Anybody home?
  10. Replies
    28
    Views
    2,963

    Re: Is this allowed?

    I see a class for a binary tree, but no way to evaluate its subtrees. Even if there are, I cannot understand how to do it.

    should I create the expression tree class first before:

    1. Create a...
  11. Replies
    28
    Views
    2,963

    Re: Is this allowed?

    This tree is a binary tree. That might be why. ;)

    :-L

    A non-leaf Node could have two non-leaf nodes, which then each have two non-leaf nodes, which then each have two non-leaf nodes and which...
  12. Replies
    28
    Views
    2,963

    Re: Is this allowed?

    Well, how do I do the evaulate method for OperatorNode? I don't know how to figure out the values in each subtree. It seems to involve recursion, but I can't figure it out at the moment.
  13. Replies
    28
    Views
    2,963

    Re: Is this allowed?

    So how do I keep track of the data at that Node?

    :confused::confused::confused::confused:^:)^^:)^:-??:-??:-??:-??:-??
  14. Replies
    28
    Views
    2,963

    Re: Is this allowed?

    public abstract class Node
    {

    protected Node left, right, parent;
    protected Object data;
    protected ArrayList<Object> childrenHolder;

    public Node(Object data, Node parent, Node left, Node ...
  15. Replies
    28
    Views
    2,963

    Re: Is this allowed?

    On getData() could I make it abstract and change the return type to Object?
  16. Replies
    28
    Views
    2,963

    Re: Is this allowed?

    Ok, so what about my getData() method? Make it abstract too?

    It is currently returning a variable of type T.
  17. Replies
    28
    Views
    2,963

    Re: Is this allowed?

    Ok, if I don't need the generic, why not?

    It's subclasses hold one particular type of data, but as that type is different, I cannot have a get Data method in my Node class. Are you suggesting I...
  18. Replies
    28
    Views
    2,963

    Re: Is this allowed?

    Ok, based on the pdf, am I doing this right?

    I have no idea what to do with tokens? Never handled them before.
  19. Replies
    28
    Views
    2,963

    Re: Is this allowed?

    public abstract class Node <T>
    {

    protected Node<T> left, right, parent;
    protected T data;
    protected ArrayList<T> childrenHolder;

    public Node(T data, Node<T> parent, Node<T> left, Node<T>...
  20. Replies
    28
    Views
    2,963

    Re: Is this allowed?

    I'm wondering if, based on the pdf assignment, I am doing this Node class right. I have a feeling I'm doing too much.
  21. Replies
    28
    Views
    2,963

    Is this allowed?

    Can I have a class, an abstract class moreover, that has two subclasses as objects?

    I think that this one may need recursion as well as Nodes.

    I almost wish I could have Node itself keep track...
Results 1 to 21 of 21