Find Jobs
Hire Freelancers

Efficient Range-Set Storage

$30-70 USD

Terminado
Publicado hace casi 11 años

$30-70 USD

Pagado a la entrega
You are to make a class RangeSet that maintains a set of integers. The storage and display of the set should be in terms of ranges- a range is a group of consecutive integers that cannot be enlarged. Input Ranges may be given in any order. Id there is only one number in a range, only one number should be displayed. Example: given 3, 5, 1, 17..19, 4 the output would be 1, 3..5, 17..19. The class must be able to handle an arbitrary number of input ranges and there is no constraint on the ranges the user can enter. Your class must store the range set as a linked list of the struct RNode. struct RNode { int start, end; RNode* next; } Each Rnode represents a range of integers. The linked list MUST be stored in increasing order and in minimal form; that is, no two nodes' ranges overlap. So, no matter what sequence of operations gives rise to it, the set {1,3,4,5,17,18,19}must be stored as 3 nodes representing ranges 1..1, 3..5 and 17..19 in that order. Your class must be stored in files RangeSet.h and RangeSet.cpp. INSTRUCTIONS Produce a class that maintains a set of integers, with functions to update and display the set in terms of ranges. it should have the following functions: void addRange(int rangeStart, int rangeEnd); //adds all integers from RANGESTART to RANGEEND inclusive to the set static RangeSet *Union(const RangeSet &alpha, const RangeSet &beta); //creates a pointer to new RangeSet that is the union of two supplied RangeSets bool isInSet(int element) const; //returns whether the value ELEMENT is in the set or not void deleteRange(int rangeStart, int rangeEnd); //delete all integers from RANGESTART to RANGEEND inclusive void deleteAllElements(); //makes the set empty void dum() const //prints out the set in a series of ranges as well as a default constructor, a destructor, and an equality tester(==). You may NOT use any data structure from the C++ Standard Template Library or other such Data Structures package. You should write a test program called [login to view URL] that vigorously tests your class. Make sure it complies in g++ on UNIX Due 6/4/14 Noon
ID del proyecto: 4577014

Información sobre el proyecto

8 propuestas
Proyecto remoto
Activo hace 11 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
Adjudicado a:
Avatar del usuario
I will be able to do this for you quickly and with high quality. Please check my PM for more info.
$35 USD en 3 días
0,0 (0 comentarios)
0,0
0,0
8 freelancers están ofertando un promedio de $55 USD por este trabajo
Avatar del usuario
Hi, I am C++ expert and can surely help you here, Thanks
$69 USD en 2 días
4,8 (108 comentarios)
5,9
5,9
Avatar del usuario
Hi we are interested
$35 USD en 3 días
5,0 (5 comentarios)
3,3
3,3
Avatar del usuario
It's like reinventing wheel, but I like it; I can do
$50 USD en 4 días
0,0 (0 comentarios)
0,0
0,0
Avatar del usuario
I have over 5 years C++ programming experience and familiar with data structure and algorithms.
$45 USD en 1 día
0,0 (0 comentarios)
0,0
0,0
Avatar del usuario
Hi, I can do this pretty fast, and low costs.
$35 USD en 3 días
0,0 (0 comentarios)
0,0
0,0
Avatar del usuario
Sounds like a fun little project. I can quickly deliver an efficient tested solution.
$35 USD en 1 día
0,0 (0 comentarios)
0,0
0,0
Avatar del usuario
Hello, I will create this C++ class to store a set of integers as a collection of ranges. I will open a PMB to introduce my ploan for this project. A IDLER
$132 USD en 7 días
0,0 (0 comentarios)
0,0
0,0

Sobre este cliente

Bandera de UNITED STATES
Clemson, United States
5,0
13
Miembro desde feb 18, 2013

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.