Find Jobs
Hire Freelancers

Write a c++ program for linked lists

$10 USD

Cerrado
Publicado hace más de 9 años

$10 USD

Pagado a la entrega
The agreement for two binary vectors A and B, each of size n+1, is defined as the following: int sum=0; for (int i=0; i<=n; i++) if (A[i]==B[i]==1) sum++; (Calculation 1) write C++ programs that compute the agreement for two given vectors (see Calculation 1 above). In these programs, in vectors A and B only nonzero elements (elements that are 1) are stored. We give you a function that generates input for a test case for your programs. Both correctness and efficiency of your programs are important. use linked lists to store the non-zero elements of the vectors. This involves changing struct definition to include a link, and writing a new agreement() function. Keep the same input vectors, but you need to write a new generate_row_and_col() function to create linked lists. /* ATTACHMENT 1: */ #include <stdio.h> #include <iostream.h> /* For Assignment #2 You are asked to write a function that calculates the agreement for two vectors, a row and a column Normally this agreement can be calculated as follows: int sum=0; for (i=0;i<=n; i++) if (A[i]==B[i]==1) sum++; (Calculation 1) But, you will need to do it differently since zeros are not stored in vectors function generate_row_and_col() below is provided only for testing. Your function should not be designed for a fixed pair of row or column vectors; row is a row vector of size at most n, col is a (column) vector of size at most n, each of these vectors stores only 1’s here we use an array to store the indices at which the element is 1 e.g. for row vector [0,0,1,0,0,1,0], which has 1’s at indices 2, and 5, respectively row[0]=2; row[1]=5; row[2]=-1 (-1 in x marks the end of non-zero elements in row) Please note that all other elements (not stored in row) are zeros Similarly let col be the following vector [0,0,0,0,0,1,0], then col[0]=5; col[1]=-1; For this pair of row and col, the agreement is 1, because row[1] =col[0]=5, and all other terms in Calculation 1 (see the top of the page) are zeros */ static const int n=1000; /* vector size limit */ struct element { int x; /* original index of non-zero array element */ int val ; /* integer non-zero value at index x */ } ; int row[n] ; int col[n] ; int i; void generate_row_and_col() { for (i=1; i<n/4; i++) row[i]=4*i; row[0]=1; row[n/4]=-1; for (i=1; i<n/5; i++) col[i]=5*i; col[0]=1; col[n/5]=-1; } int agreement() { /* calculate the agreement for row and col; output the result */ } int main() { generate_row_and_col() ; agreement(); return 0;}
ID del proyecto: 6434993

Información sobre el proyecto

20 propuestas
Proyecto remoto
Activo hace 10 años

¿Buscas ganar dinero?

Beneficios de presentar ofertas en Freelancer

Fija tu plazo y presupuesto
Cobra por tu trabajo
Describe tu propuesta
Es gratis registrarse y presentar ofertas en los trabajos
20 freelancers están ofertando un promedio de $22 USD por este trabajo
Avatar del usuario
Hello. It looks as easy thing. Can be done in short time ................................................
$10 USD en 1 día
4,9 (1054 comentarios)
7,5
7,5
Avatar del usuario
I am very proficient in c, c++. I have 15 years c++ developing experience now, and I have worked for 5 years. My work is online game developing, and mainly focus on server side, the lauguage is c++ under linux os. So, programming in c++ is never a problem. I used c++ to make many great projects, for example, I made the tools which can convert java files to c++ with the same meaning, of course garbage collection included. I made our own mobile game using c++, I even can show you the demo of client. Trust me, please let expert help you.
$14 USD en 0 día
4,9 (138 comentarios)
6,9
6,9
Avatar del usuario
Hi! I am professional C/C++/C#/Java programmer. I can do this project with highest quality! Best Regards, Szymszteinsl
$10 USD en 1 día
4,9 (63 comentarios)
6,7
6,7
Avatar del usuario
A proposal has not yet been provided
$15 USD en 1 día
4,6 (23 comentarios)
4,6
4,6
Avatar del usuario
can do it.................................................................................................................
$100 USD en 1 día
4,9 (8 comentarios)
4,1
4,1
Avatar del usuario
Hi I am a data structures and algorithm specialist. Please review my profile and let me know if you are interested. Thanks
$35 USD en 1 día
5,0 (7 comentarios)
3,9
3,9
Avatar del usuario
A proposal has not yet been provided
$15 USD en 1 día
5,0 (10 comentarios)
2,8
2,8
Avatar del usuario
Hello, I am a software engineer with expert skills in C/C++ programming. P/S: I'm new to freelancer.com, please give me a chance and I won't let you down.
$15 USD en 1 día
4,6 (2 comentarios)
3,0
3,0
Avatar del usuario
I am algorithm expert. I can help you doing this project. Let me know if you need me for linked list in c++. Best Regards -- Jam
$25 USD en 1 día
5,0 (4 comentarios)
2,2
2,2
Avatar del usuario
Hi I am an experienced C/C++/Java developer with excellent skills in data structures and algorithms. I will be happy to work on this project and assure to deliver quality work. My work experience includes internship at Google(2012) and working with several start-ups in Kenya to deliver android mobile and web solutions. Thanks and regards, Isaac
$30 USD en 2 días
4,4 (2 comentarios)
2,0
2,0
Avatar del usuario
i can give you a complete code with in 8-9 hours,, if you are interested then contact me thank s ,,,,,,,,,,,
$40 USD en 0 día
4,2 (1 comentario)
0,5
0,5
Avatar del usuario
A proposal has not yet been provided
$16 USD en 2 días
0,0 (0 comentarios)
0,0
0,0
Avatar del usuario
I'm a student of Bachelor in Software Engineering. I learned c++ and data structure last semester. So I can handle it.....
$13 USD en 1 día
0,0 (0 comentarios)
0,0
0,0
Avatar del usuario
I have a good experience in data structures like pointers, stack and list I can also offer a free maintenance the code I can also help with other requirements for the software
$15 USD en 1 día
0,0 (0 comentarios)
0,0
0,0
Avatar del usuario
I have a masters in CS and already gave programming and algorithms classes to two universities. Have experience in C/C++ and published papers in parallel programming. Thanks, Henrique Fingler.
$13 USD en 1 día
0,0 (0 comentarios)
0,0
0,0
Avatar del usuario
I am constantly participating on various coding competition and been to ICPC(International Collegiate Programming Competition).
$13 USD en 0 día
0,0 (0 comentarios)
0,0
0,0
Avatar del usuario
I'm an experienced C++ developer please see my resume. I've helped people with school projects etc off of this site in the past please see feedback. I can help. Kind Regards
$25 USD en 1 día
0,0 (0 comentarios)
0,0
0,0
Avatar del usuario
i have solved your problem ....if interested then contact me...waiting for your response....changes in program can be possible according your need.
$15 USD en 1 día
0,0 (0 comentarios)
0,0
0,0
Avatar del usuario
Hi, I have experience in working with data structures and C++ programming.I'm very interested to work on your project.I can assure You that,if You choose me,the project will be done in specified time frame and it will met quality recommendations. Thank You, Goran Hristov, Engineer of Electronics
$10 USD en 3 días
0,0 (0 comentarios)
0,0
0,0

Sobre este cliente

Bandera de UNITED STATES
Carrollton, United States
0,0
0
Miembro desde sept 10, 2014

Verificación del cliente

¡Gracias! Te hemos enviado un enlace para reclamar tu crédito gratuito.
Algo salió mal al enviar tu correo electrónico. Por favor, intenta de nuevo.
Usuarios registrados Total de empleos publicados
Freelancer ® is a registered Trademark of Freelancer Technology Pty Limited (ACN 142 189 759)
Copyright © 2024 Freelancer Technology Pty Limited (ACN 142 189 759)
Cargando visualización previa
Permiso concedido para Geolocalización.
Tu sesión de acceso ha expirado y has sido desconectado. Por favor, inica sesión nuevamente.