Thread: I need some solution for linked list and file

  1. #1
    Registered User
    Join Date
    Mar 2009
    Posts
    5

    I need some solution for linked list and file

    I have the exercise about linked list and file, so can you help me or give me some solution


    Code:
     Print the result to the output file named: output.txt 
    a)  First line: two numbers (separated by a white space). First number is the sum of all 
    nodes, which have positive values. Second number is the position of the node, which 
    has the maximum value (as described in the #2.f above).  
    b)  Second line: Nodes inside the list before it is sorted. Each is separated by a white 
    space. 
    c)  Third line: Nodes inside the list after it is sorted. Each is separated by a white space. 
     
    For example: 
     
    Input.txt 
    6 2 4 3 
    -2 4 1 -3 7 6 
     
    Output.txt  
    22 4 
    -2 4 1 4 7 6 
    -2 1 4 4 6 7

  2. #2
    Registered User
    Join Date
    Oct 2008
    Location
    TX
    Posts
    2,059
    What have you written or tried so far?

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. singly linked circular list
    By DarkDot in forum C++ Programming
    Replies: 0
    Last Post: 04-24-2007, 08:55 PM
  2. Please Help - Problem with Compilers
    By toonlover in forum C++ Programming
    Replies: 5
    Last Post: 07-23-2005, 10:03 AM
  3. Replies: 3
    Last Post: 03-04-2005, 02:46 PM
  4. How can I traverse a huffman tree
    By carrja99 in forum C++ Programming
    Replies: 3
    Last Post: 04-28-2003, 05:46 PM
  5. Contest Results - May 27, 2002
    By ygfperson in forum A Brief History of Cprogramming.com
    Replies: 18
    Last Post: 06-18-2002, 01:27 PM