Ask Experts Questions for FREE Help !
Ask
    syaminismail's Avatar
    syaminismail Posts: 2, Reputation: 1
    New Member
     
    #1

    Oct 6, 2011, 08:51 AM
    I'm need somebody to hepl me answer this question about C now please...
    1) Write a full program for the bubble sort algorithm. User is required to enter specific input numbers and the program will be able to sort the given numbers in ascending order. Write down in a table the time (according to your system clock) that it takes for the program to complete. You may do this by running the program for several values of input.

    Hints:
    A) Write full source code
    B) Use system clock to measure the running time
    C) Use several input (eg: N = 100 , N = 1000 , N = 10000, N = 100000 etc)
    D) Have access to a file (to store your running time)

    2) What is the difference between static and dynamic memory allocations? List advantages and disadvantages for the both type of memory allocations.


    3) Use structure to wrap student information (such as Matrix Number, name and MTS 3023 mark) and manipulate it by reading information to an array of student structure and print them on to console screen.


    4) The common error message which might encounter in your program is ?memory access violation? Or ?segmentation violation? What does it mean? How to avoid it?


    5) For each of the following four program fragments:
    A. Give an analysis of the running time (Big-Oh)
    B. Implement the code and give the running time for several values of N
    C. Compare your analysis with the actual running times

    1) Sum = 0;
    For( I = 0 ; I < N; I )
    Sum ;
    2) Sum = 0;
    For( I = 0 ; I < N; I )
    For (j = 0 ; j < N ; j )
    Sum ;
    3) Sum = 0;
    For( I = 0 ; I < N; I )
    For (j = 0 ; j < I ; j )
    Sum ;
    4) Sum = 0;
    For( I = 0 ; I < N; I )
    For (j = 0 ; j < I *i; j )
    Sum ;



    6) Implement in two separate files, called fibonacci1.cpp and fibonacci2.cpp, the iterative and the recursive methods for computing Fibonacci numbers. The programs should read from the standard input the value of N, and output the corresponding Fibonacci value. Write down in a table the time (according to your system clock) that it takes for each program to complete, for each of the following N values: 1, 2, 4, 8, 16, 32, 64.
    kcomissiong's Avatar
    kcomissiong Posts: 1,166, Reputation: 276
    Ultra Member
     
    #2

    Oct 6, 2011, 11:23 AM
    I'm actually not an expert in this area, but those who are will want to see your work before they help with it, per the rules of the site. If you will post your work in this thread, they can help you where you are stuck and have made mistakes or explain a concept.

Not your question? Ask your question View similar questions

 

Question Tools Search this Question
Search this Question:

Advanced Search

Add your answer here.


Check out some similar questions!

Three year old won't answer a question, he only repeats the question... any thoughts? [ 7 Answers ]

I have three children who have never had any learning troubles however I babysit 2 kids each day that seem to be a little socially awkward. The oldest (age 5 1/2) won't look me in the eye and can't follow a multi-step instruction. The younger (age 3) has never been able to answer a question I ask...

Physics question... with answer, yet I don't know how to get the answer. [ 2 Answers ]

In order to qualify for the finals in a racing event, a car must achieve an average speed of 270 Km/h on a track with a total length of 1410 m. If a particular car covers the first half of the track at an average speed of 232 km/h, what minimum average speed must it have in the second half of the...

Worried and need hepl from people that kan give me an answer or can relate [ 2 Answers ]

I am 19 years old I am sexually active and I been haven white bumps for about 8 months already.they go away and some stay down there and mre grow.what is this sytom? I been checked but the doctor said there's nothing to Worrie about and they been dwn on my viginal area for about 8 mnths still>>>I...

Someone hepl me! [ 1 Answers ]

I really need some advice on soul custody. Can a child be placed with one parent to soul custody with one time drug use? As I am a great mom and love my child soooo much I need some answers, it feels like everybody has a say in her life but me


View more questions Search