Urgent need of code in C

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • ne0
    New Member
    • Sep 2006
    • 1

    Urgent need of code in C

    Hey guys,
    hope you could help me,
    i am writing a program in which it reads a file text and than generates a report containing a list of words of 1letter, 2letters..
    every list should be made in an alphabetical order.
    for example the report should be like this:

    word of 1 lettre(s) :
    a
    l

    word of 2 lettre(s) :
    by
    of
    an

    word of 5 lettre(s) :
    begin
    start


    Hope you guys could help me ASAP
  • r035198x
    MVP
    • Sep 2006
    • 13225

    #2
    Originally posted by ne0
    Hey guys,
    hope you could help me,
    i am writing a program in which it reads a file text and than generates a report containing a list of words of 1letter, 2letters..
    every list should be made in an alphabetical order.
    for example the report should be like this:

    word of 1 lettre(s) :
    a
    l

    word of 2 lettre(s) :
    by
    of
    an

    word of 5 lettre(s) :
    begin
    start


    Hope you guys could help me ASAP

    Do you know how to read a file?
    You are most likely going to have to write this yourself. So I'd suggest you really make a start. Try to write down the logic of it and the steps required to achieve your goal even in english, you'll find it will be easier to write the code after that.

    Comment

    • ltgbau
      New Member
      • Sep 2006
      • 41

      #3
      steps:
      1/ read file
      2/ parse data : use space, dot...as separators
      3/ check word if exists and add to list
      that's all
      :D

      Comment

      • AlekseyUS
        New Member
        • Sep 2006
        • 10

        #4
        an should come befoe by in the 2 letter words? unline in your example

        Comment

        • chitrajha
          New Member
          • Sep 2006
          • 2

          #5
          i need to understand..... .d concepts ot link lists....queues ..stacks...
          nd implement dem in...evc++
          can nyone plz help me out wid dis....!!!

          Comment

          • chitrajha
            New Member
            • Sep 2006
            • 2

            #6
            hello..

            can nyone heer me...?

            den plz help me out..!!!!!!

            i jus cant implement dem...in EVC++....
            i had earlier tried it in C....

            Comment

            • D_C
              Contributor
              • Jun 2006
              • 293

              #7
              You may want a linked list of linked lists. The second list has all N letter words sorted in alphabetical order. The first list has each N, sorted in increasing order.

              1. Open the file
              2. Parse out each word
              3. Add it appropriately to the following data structure.
              4. When EOF, traverse and print the data structure.

              Example: The quick brown fox jumped over the lazy dog
              Code:
              3 -> The -> dog -> fox -> the -> NULL
              |
              v
              4 -> over -> lazy -> NULL
              |
              v
              5 -> brown -> quick -> NULL
              |
              v
              6 -> jumped -> NULL
              |
              v
              NULL

              Comment

              • ltgbau
                New Member
                • Sep 2006
                • 41

                #8
                Originally posted by chitrajha
                i need to understand..... .d concepts ot link lists....queues ..stacks...
                nd implement dem in...evc++
                can nyone plz help me out wid dis....!!!
                i think you need to read data structures and algorithms books
                search in the net

                Comment

                Working...