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

    Oct 6, 2011, 08:47 AM
    Who at here know answer c ?
    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.
    (20 marks)

Check out some similar questions!

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...

When writing an Answer do you have to re-state each count/paragraph or just answer? [ 8 Answers ]

I am wondering if I have to type the exact counts and paragraphs and then admit or deny each or can I just admit or deny to the number indicated?


View more questions Search
 

Question Tools Search this Question
Search this Question:

Advanced Search

Add your answer here.