Implement algorithm in C

Σε Εξέλιξη

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

Δεξιότητες: Αλγόριθμος, Γλώσσα Προγραμματισμού C

Δείτε περισσότερα: linked list algorithm in data structure using c, graph library c, c program to implement dijkstra algorithm using priority queues, c algorithm tutorial, c algorithm questions, c algorithm interview questions, c algorithm binary search, binary search in c algorithm, algorithm of prime number in c, algorithm of binary search in c, algorithm for priority queue in c, algorithm for prime numbers in c, algorithm for binary search in c, algorithm and data structure in c, c++ algorithm, C algorithm, algorithm implement btree, algorithm implement matlab, implement algorithm trading system project involve, implement longest common subsequence algorithm, algorithm implement distance vector, implement distance vector algorithm, algorithm implement

ID Εργασίας: #11788748

Ανατέθηκε στον/στην:

mrshahidlatif

........................................................................................................

$30 USD σε 3 μέρες
(4 Αξιολογήσεις)
2.4

10 freelancers κάνουν προσφορές με μέσο όρο $44 γι' αυτή τη δουλειά

it2051229

hi there I would like to do this project if given the opportunity. let me know if you are interested so I can have further details. thanks.

$30 USD σε 1 μέρα
(413 Αξιολογήσεις)
6.6
utkarshkatiyar19

I can do

$60 USD σε 1 μέρα
(104 Αξιολογήσεις)
5.8
$78 USD σε 1 μέρα
(6 Αξιολογήσεις)
3.9
$25 USD σε 1 μέρα
(6 Αξιολογήσεις)
3.8
$30 USD σε 1 μέρα
(10 Αξιολογήσεις)
3.1
ExperSolutions

We are team of excellent developers and writers. We have 2 year experience related to your project field. We can do your project and solve your all problems according to your requirements. We have read your description Περισσότερα

$20 USD σε 1 μέρα
(2 Αξιολογήσεις)
1.9
$25 USD σε 1 μέρα
(2 Αξιολογήσεις)
1.2
TR49

I’d like to be considered for your Implement algorithm in C Project. I'm software engineer with more then 3 years experience in Development & Designing. I'm expert in C, C++, C#, Java, Python, Ruby, Software Develo Περισσότερα

$25 USD σε 0 μέρες
(2 Αξιολογήσεις)
1.3
anson418

My name is Anson, I am a programmer of around 10 years now from the United States, educated at the University of California. My bid is slightly on the higher side, but if you are willing to pay the extra, I promise th Περισσότερα

$50 USD σε 1 μέρα
(0 Αξιολογήσεις)
0.0
fastwriter24

We are highly experienced Post Graduate Engineers, Doctors, IT, ITES, Software, Infrastructure Professionals, Web Designers and IT Architects. We can redo, improve, and publish any engineering, scientific MATLAB, S Περισσότερα

$150 USD σε 1 μέρα
(0 Αξιολογήσεις)
0.0
mohammesultan4

Hi, Thank you very much for posting this project i like to complete your project in a smooth fashion, i like you to check my ability either by directly giving the project or first check my profile an decide. Περισσότερα

$25 USD σε 1 μέρα
(0 Αξιολογήσεις)
0.0
djmbdv

Hello This is a example code, I can to make a better code #include <stdio.h> void preserveTopNValues(double* data, size_t size, size_t n) { int i; for(i = 0; i < n, ++i) { if(i > size ) { data[i Περισσότερα

$25 USD σε 10 μέρες
(0 Αξιολογήσεις)
0.0