Search:

Type: Posts; User: Loraeron

Page 1 of 2 1 2

Search: Search took 0.28 seconds.

  1. Replies
    35
    Views
    986

    Re: Using Stacks Homework Help

    no it's still wrong, during the first pass it should find all the delimiters in the code that i'm looking for then compare them with the delimiters in the stack. It is only finding one of them...
  2. Replies
    35
    Views
    986

    Re: Using Stacks Homework Help

    ok, so i added it into the catch block, and found the error. it was just an error where i had placed code to display what was being stored in strLine for debugging, don't need that anymore as i...
  3. Replies
    35
    Views
    986

    Re: Using Stacks Homework Help

    the pass number is just a variable i called x that i incremented after each time through the while and printed so i knew how many times it is reading the text file and what is being seen with each...
  4. Replies
    35
    Views
    986

    Re: Using Stacks Homework Help

    ok, here is it broken down a little better, i added another println stating the pass it was in during each loop of the while along with the pass number:



    run:
    Enter a file to be read: (EX:...
  5. Replies
    35
    Views
    986

    Re: Using Stacks Homework Help

    Ok, i did the println() portion and it looks like it is reading in the entire text file.
  6. Replies
    35
    Views
    986

    Re: Using Stacks Homework Help

    haha, i read it and did some text, using it with a variable that i tried to increment after each readLine call.

    int x = 0;

    after the readLine did x++;

    and then it went into:
    ...
  7. Replies
    35
    Views
    986

    Re: Using Stacks Homework Help

    so what would you attach charAt() too? Would you simple say if(strLine.charAt() = "{") then do this.....?
  8. Replies
    35
    Views
    986

    Re: Using Stacks Homework Help

    how would you implement charAt()? because i don't know exactly where the braces, brackets, etc will be?
  9. Replies
    35
    Views
    986

    Re: Using Stacks Homework Help

    ok, so would i need to convert each line during the while loop into an array of characters before passing them into the if statements checking for proper types?
  10. Replies
    35
    Views
    986

    Re: Using Stacks Homework Help

    I thought using the readLine() method would automatically read the entire line until it found no more words/characters then move to the next line?
  11. Replies
    35
    Views
    986

    Re: Using Stacks Homework Help

    That would be the issue I am having, I can't make it find brackets, braces, etc on a line that has characters already on it.
  12. Replies
    35
    Views
    986

    Re: Using Stacks Homework Help

    I'll look into it, either way i'm still at a loss for why it's not finding all the parameters i'm looking for in the first pass. I don't think the second pass is effecting this at all.
  13. Replies
    35
    Views
    986

    Re: Using Stacks Homework Help

    I wrote it for two haha, didn't know a way to make it read twice without opening the file and closing then reopening and closing.
  14. Replies
    35
    Views
    986

    Re: Using Stacks Homework Help

    New code after adding print statements after every push or pop with the stack



    /*
    * A Java program can have the following type of delimiters: {, }, (, ), [,
    * and ]. In a correct Java...
  15. Replies
    35
    Views
    986

    Re: Using Stacks Homework Help

    how do you actually do the tag trick, i've never done that before. I will go through and add println()
  16. Replies
    35
    Views
    986

    Re: Using Stacks Homework Help

    Updated code is below, it seems it is holding a value in the stack which is good, we are getting a error null for some reason, but the code still runs, only other problem is it is only holding one of...
  17. Replies
    35
    Views
    986

    Re: Using Stacks Homework Help

    After adding a print statement right below the code


    while((strLine = br.readLine()) != null)
    {

    during the first read file cycle it prints out:


    run:
  18. Replies
    35
    Views
    986

    Using Stacks Homework Help

    I will go ahead and apologize for the massive code slice, but I am stuck on a problem. The code compiles and runs, but is not acting properly. I have tried to comment as best I can throughout the...
  19. Replies
    49
    Views
    2,435

    Re: Sort and Merge Two Linked List

    Nevermind, managed to clear the error, code will compile and run, but gets stuck in an endless loop when it enters the TraverseMerge() method and i'm not sure why:



    package hw3_vinson;
    import...
  20. Replies
    49
    Views
    2,435

    Re: Sort and Merge Two Linked List

    Here is the full code, the only error i'm getting is trying to use .next during my traverseMerge() method at the bottome



    package hw3_vinson;
    import java.util.LinkedList;
    import javax.xml.*;...
  21. Replies
    49
    Views
    2,435

    Re: Sort and Merge Two Linked List

    What do you think of this:



    public Node get(int x)
    {
    int searchLoc = x;
    Node ref = firstElement;
    int counter = 0;
  22. Replies
    49
    Views
    2,435

    Re: Sort and Merge Two Linked List

    I'm still at a bit of a loss as to what would be inside the:



    public Node get(int x)
    {
    int searchLoc = x;
  23. Replies
    49
    Views
    2,435

    Re: Sort and Merge Two Linked List

    So.....:



    public int size()
    {
    int count = 0;
    Node ref = firstElement;
    while(ref != null)
    {
  24. Replies
    49
    Views
    2,435

    Re: Sort and Merge Two Linked List

    Well right now an error, because where i declare temp1 and temp2 right under LinkedList LL03 i don't assign anything because i'm stuck there. I need a way to retrieve the starting node of each list...
  25. Replies
    49
    Views
    2,435

    Re: Sort and Merge Two Linked List

    i meant it to be the built in .next not a method i create shouldn't have placed the ().

    When the end of one of the list is found it will jump to another if that says
    if (LL01 == null)
    {
    ...
Results 1 to 25 of 44
Page 1 of 2 1 2