Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

1. Remember the sorting algorithms quick sort (Tony Hoare, 1959) and merge sort (John von Neumann, 1945). 2. Write each sorting algorithm in C and

image text in transcribed

1. Remember the sorting algorithms quick sort (Tony Hoare, 1959) and merge sort (John von Neumann, 1945). 2. Write each sorting algorithm in C and in Haskell by implementing the following functions: void qsort2(int *a, int n); void msort(int *a, int n); // quick sort array a with n elements in place in C // merge sort array a with n elements in place in C qsort :: Ord a => [a] -> [a] msort :: Ord a => [a] -> [al -- quick sort a list in Haskell -- merge sort a list in Haskell 3. Write a brief comment for every line of your code explaining what it does. 4. In a separate text file write a few sentences explaining how and why the C and Haskell implementations of the same algorithms differ. 5. Write a simple main function (one in C and one in Haskell) to test your sort functions with the input sequence 4, 65, 2, -31, 0, 99, 2, 83, 782, 1 and print the result to the console. 1. Remember the sorting algorithms quick sort (Tony Hoare, 1959) and merge sort (John von Neumann, 1945). 2. Write each sorting algorithm in C and in Haskell by implementing the following functions: void qsort2(int *a, int n); void msort(int *a, int n); // quick sort array a with n elements in place in C // merge sort array a with n elements in place in C qsort :: Ord a => [a] -> [a] msort :: Ord a => [a] -> [al -- quick sort a list in Haskell -- merge sort a list in Haskell 3. Write a brief comment for every line of your code explaining what it does. 4. In a separate text file write a few sentences explaining how and why the C and Haskell implementations of the same algorithms differ. 5. Write a simple main function (one in C and one in Haskell) to test your sort functions with the input sequence 4, 65, 2, -31, 0, 99, 2, 83, 782, 1 and print the result to the console

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Application Development And Design

Authors: Michael V. Mannino

1st Edition

0072463678, 978-0072463675

More Books

Students also viewed these Databases questions

Question

How many bytes is the huffman file header?

Answered: 1 week ago

Question

Explain what is meant by the terms unitarism and pluralism.

Answered: 1 week ago