Search:

Type: Posts; User: tiagoufrj

Search: Search took 0.09 seconds.

  1. Replies
    7
    Views
    2,625

    Re: Reversing lines using LinkedList

    You can divide the lines of file in words so you add the words into linkedlist.

    For example:




    while(input.hasNextLine())
    {
    String[] words =...
  2. [SOLVED] Re: Program to find how many letters start with vowels

    >What about the startsWith(String prefix) method?

    You can to use startsWith. But you have to use for each letter. For example:




    if(s.startsWith("a") || s.startsWith("e") ||...
  3. Replies
    4
    Views
    1,282

    Re: Outofbounds error

    First,

    In main function you call Snowflake.selectionSort(Snowflake.array, 0). If startingIntex has zero value, then index starts with -1 and the array[-1] is called.




    for (int index =...
  4. Replies
    7
    Views
    2,625

    Re: Reversing lines using LinkedList

    You are printing the object "input" and not its content. You can print the contents of the file this way:




    Scanner scan = new Scanner (System.in);
    File f = new File("prezodent.txt"); ...
  5. [SOLVED] Re: Program to find how many letters start with vowels

    You code don't work because you forget of to write b.charAt(d-1). You wrote only (d-1).


    if(((e=='a')||(e=='e')||(e=='i')||(e=='o')||(e=='u'))&&(b.charAt(d-1)==' ')&(d!=0))

    ...
  6. Replies
    10
    Views
    1,918

    Re: what's wrong with my linked list

    Because the variable Header is null when the line Header.next=n.prev; is running.

    >Header should be initialized to what?

    Thats depends on what you want. What does variable Header means?
  7. Replies
    10
    Views
    1,918

    Re: what's wrong with my linked list

    Where you initialize the variable Header? It need to be initialized somewhere.
  8. Re: help guys.. could you tell me what am i doing wrong?

    If A and B are circles. B is contained in A if and only if the distance between A and B plus the radius of B is smaller than radius of A.

    make sense? I think so.
  9. Replies
    7
    Views
    2,625

    Re: Reversing lines using LinkedList

    You can get the text file using the BufferedReader and store it in a variable. So, you can to split the variable using a function split("[ ]+").

    For example,




    // load text using...
  10. Replies
    7
    Views
    2,625

    Re: Reversing lines using LinkedList

    I don't understand your problem. On my computer your program runs normally and fast. However it doesn't reverse the list because the correct is phrase = reverse(phrase);
  11. [SOLVED] Re: Storing info into a text file & adding to it

    Hi,

    You have to use the constructor new FileWriter(info, true) to add text to the file.

    work?
Results 1 to 11 of 11