Hello, as it can be inferred from profile, I am new. I have read the community guidelines and I have done prior research.
I am a very weak coder(through my own fault). However, I like to believe I firm conceptual understanding.

So What is my problem? I have an assignement that requires analysis of three fast sorting algorithms(radix, quick sort, and merge sort). The exact specifications are as follows:

  1. Design and implement a variation of QuickSorter class that partitions the
    sequence to be sorted using the pivot other than the first element in the
    sequence.
    Run a sequence of experiments to compare the running times of your sorter
    with your new pivot selection.

  2. Design and implement Radix sorter of an array by using and Queue ADT for
    each group.
    Run a sequence of experiments to compare the running times.

  3. Design and implement Merge sorter of an array by using recursion.
    Run a sequence of experiments to compare the running*

I understand how the three algorithms work. However, I still need guidence on how I will go about creating a program that will implement all three and compare the running times.

Specific questions

1)How will I go about timing my algorithms?
2)What will be the most effective way to implement the algorithms?(will I create 3 sorting classes?)
3)How do I record the number of computations required for each algorithm?
4)What resources will help me become a stronger coder for future assignments?

Thank you for help and understanding.

  1. Use a timer. For an example, Click Here

  2. Create 3 sorting functions.

  3. Use a counter.

  4. There is no substitution for practice.

Question. Is this on a Linux system, or is it Windows? The standard Linux/Posix C/C++ libraries have some common interval timer functions that can get you down to millisecond to microsecond or nanosecond intervals. Not sure about Windows. I use these in Linux frequently in order to determine if stuff (network operations and such) is taking too much time in order to trigger off retry / reconnect logic.

As for the sorting/merging code, read Knuth's Volume 3 "Sorting and Searching". He covers most of this stuff pretty darned well. In any case, make an attempt to solve the coding problem and we can help with issues you may run into. That said, we do not do your homework for you! :-)

It is on a windows machine and thank you for the resource. This is exactly what I was looking for.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.