Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 7 of 7

Thread: CAN any one do this !

  1. #1
    Junior Member
    Join Date
    Feb 2013
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Lightbulb CAN any one do this !

    Question: We are given an array of 2n integers wherein each pair in this array of integers represents the year of birth and the year of death of a dinosaurs respectively. The range of valid years we want to consider is [-100000 to 2005]. For example, if the input was:

    -80000 -79950 20 70 22 60 58 65 1950 2004

    it would mean that the first dinosaur had a birth year of –80000 and an year of death of –79950 respectively. Similarly the second dinosaur lived from 20 to 70 and so on and so forth.

    We would like to know the largest number of dinosaurs that were ever alive at one time. Write a method to compute this, given the above array of 2n integers.

    Write one of the following methods:

    C/C++:
    int find_max_dinosaur (int[] years);

    Java :
    public int findMaxdinosaur (int[] yaears);


    hope you help me experts

  2. #2
    Junior Member
    Join Date
    Feb 2013
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Lightbulb CAN any one do this !

    Question: We are given an array of 2n integers wherein each pair in this array of integers represents the year of birth and the year of death of a dinosaurs respectively. The range of valid years we want to consider is [-100000 to 2005]. For example, if the input was:

    -80000 -79950 20 70 22 60 58 65 1950 2004

    it would mean that the first dinosaur had a birth year of –80000 and an year of death of –79950 respectively. Similarly the second dinosaur lived from 20 to 70 and so on and so forth.

    We would like to know the largest number of dinosaurs that were ever alive at one time. Write a method to compute this, given the above array of 2n integers.

    Write one of the following methods:

    C/C++:
    int find_max_dinosaur (int[] years);

    Java :
    public int findMaxdinosaur (int[] yaears);


  3. #3
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,042
    Thanks
    63
    Thanked 2,708 Times in 2,658 Posts

    Default Re: CAN any one do this !

    Do you have any specific questions about your assignment?
    Please post your code and any questions about problems you are having.
    If you don't understand my answer, don't ignore it, ask a question.

  4. #4
    Junior Member
    Join Date
    Feb 2013
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Lightbulb plz tell the method

    Question: We are given an array of 2n integers wherein each pair in this array of integers represents the year of birth and the year of death of a dinosaurs respectively. The range of valid years we want to consider is [-100000 to 2005]. For example, if the input was:

    -80000 -79950 20 70 22 60 58 65 1950 2004

    it would mean that the first dinosaur had a birth year of –80000 and an year of death of –79950 respectively. Similarly the second dinosaur lived from 20 to 70 and so on and so forth.

    We would like to know the largest number of dinosaurs that were ever alive at one time. Write a method to compute this, given the above array of 2n integers.

    Write one of the following methods:

    C/C++:
    int find_max_dinosaur (int[] years);

    Java :
    public int findMaxdinosaur (int[] yaears);

  5. #5
    Crazy Cat Lady KevinWorkman's Avatar
    Join Date
    Oct 2010
    Location
    Washington, DC
    Posts
    5,424
    My Mood
    Hungover
    Thanks
    144
    Thanked 636 Times in 540 Posts

    Default Re: plz tell the method

    What have you tried? Where are you stuck?

    This isn't a homework service. Please see the link in my signature on asking questions the smart way: especially the bits about using descriptive titles and asking specific questions.

    --- Update ---

    I've merged your duplicate threads. Please stop spamming multiple copies of the same question, and please stop privately messaging members the same thing. This is your homework, not ours. If you put as much effort into actually doing it as you're putting into *not* doing it, you'd be done by now.
    Useful links: How to Ask Questions the Smart Way | Use Code Tags | Java Tutorials
    Static Void Games - Play indie games, learn from game tutorials and source code, upload your own games!

  6. #6
    Super Moderator curmudgeon's Avatar
    Join Date
    Aug 2012
    Posts
    1,130
    My Mood
    Cynical
    Thanks
    64
    Thanked 140 Times in 135 Posts

    Default Re: CAN any one do this !

    I vote we lock this thread since it appears to be little more than a homework dump, but agree we give him a little time to reply first to show his efforts and to ask a specific question.

  7. #7
    Super Moderator curmudgeon's Avatar
    Join Date
    Aug 2012
    Posts
    1,130
    My Mood
    Cynical
    Thanks
    64
    Thanked 140 Times in 135 Posts

    Default Re: CAN any one do this !

    OK, thread locked. I invite the original poster to ask new questions, but if so, to show their work and to not ask others to do his work for him.

  8. The Following User Says Thank You to curmudgeon For This Useful Post:

    KevinWorkman (February 1st, 2013)