Ολοκληρώθηκε

Implement algorithm in C

Αυτό το πρότζεκτ ολοκληρώθηκε επιτυχώς από τον mrshahidlatif για $30 USD σε 3 μέρες.

Λάβετε δωρεάν αναφορές για ένα πρότζεκτ σαν αυτό
Εργασία Εργοδότη
Προϋπολογισμός Εργασίας
$10 - $30 USD
Ολοκληρώθηκε σε
3 ημέρες
Σύνολο Προσφορών
13
Περιγραφή Εργασίας

You need to implement following two functions in C language:

void preserveTopNValues(double* data, size_t size, size_t n);

void fastPreserveTopNValues(double* data, size_t size, size_t n);

Detailed explanation:

Array "data" contains "size" values which may go in any order (i.e. can be both sorted or unsorted)

and may have duplicates.

Both functions must find top "n" unique absolute values in the "data" and preserve them,

and set other elements of array to zero.

Function "preserveTopNValues" must complete the abovementioned task with minimum additional memory usage,

while may do it slower.

Function "fastrPreserveTopNValues" must complete the abovementioned task with maximum speed,

while may use more additional memory.

Other requirements:

1. Functions must be implemented in plain C (not C++ !!!)

2. Code must conform to C99 standard.

3. Code must be formatted according to Linux astyle and well commented.

4. Code must use "camel case" naming of variables and functions.

5. Code must be compilable without errors on Linux with GCC 4.8.2+ with following compiler options set:

-Wall -Wextra -Werror -std=c99

6. Function can use only standard C library, usage of any 3rd party libraries is strictly not allowed.

Deliverables:

1. Source code of functions.

2. Sample program (also delivered as source code) that:

- dispays input data

- calls functions

- dispays output data

- proves that output matches to expected result

- proves that both functions give the same output on the same inputs.

3. GNU Make compatible Makefile to build the sample program.

4. Small plain text file called [url removed, login to view] that shortly explains both algorithms and why they were chosen for the particular variant of implementation (normal/fast).

Ολοκληρώθηκε από:
Απαιτούμενες Δεξιότητες

Ψάχνετε τρόπους για να κερδίσετε μερικά χρήματα;

  • Ορίστε τον προϋπολογισμό σας και το χρονικό πλαίσιο
  • Περιγράψτε την πρότασή σας
  • Πληρωθείτε για τη δουλειά σας

Προσλάβετε Freelancers που ήδη έχουν υποβάλει προσφορά σε αυτή την εργασία

    • Forbes
    • The New York Times
    • Time
    • Wall Street Journal
    • Times Online