Please Please Help

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • jnekoonam
    New Member
    • Jul 2007
    • 2

    #1

    Please Please Help

    Hi,
    Here's my question. I have a sample file listed bellow:

    10 11 12 13 14 14 13 12 11 10
    10 11 12 13 12 11 10
    10 11 12 10 11 12

    Note that these data are in a file. Each line in the file will contain a set of integers separated by spaces. how can I write a program that reads the name of a file from the command line, determine whether the first half of the numbers are sorted in ascending order and the second half of the numbers in descending order?? The first half and second half must contain the same integers.

    I want to be able to do this with stacks and queues as well as with vectors.

    Thanks
  • r035198x
    MVP
    • Sep 2006
    • 13225

    #2
    Originally posted by jnekoonam
    Hi,
    Here's my question. I have a sample file listed bellow:

    10 11 12 13 14 14 13 12 11 10
    10 11 12 13 12 11 10
    10 11 12 10 11 12

    Note that these data are in a file. Each line in the file will contain a set of integers separated by spaces. how can I write a program that reads the name of a file from the command line, determine whether the first half of the numbers are sorted in ascending order and the second half of the numbers in descending order?? The first half and second half must contain the same integers.

    I want to be able to do this with stacks and queues as well as with vectors.

    Thanks
    What have you done so far?

    Comment

    Working...