Find Jobs
Hire Freelancers

Efficient Range-Set Storage

$30-70 USD

Abgeschlossen
Veröffentlicht vor fast 11 Jahren

$30-70 USD

Bezahlt bei Lieferung
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
Projekt-ID: 4577014

Über das Projekt

8 Vorschläge
Remote Projekt
Aktiv vor 11 Jahren

Möchten Sie etwas Geld verdienen?

Vorteile einer Ausschreibung auf Freelancer

Legen Sie Ihr Budget und Ihren Zeitrahmen fest
Für Ihre Arbeit bezahlt werden
Skizzieren Sie Ihren Vorschlag
Sie können sich kostenlos anmelden und auf Aufträge bieten
Vergeben an:
Avatar des Nutzers
I will be able to do this for you quickly and with high quality. Please check my PM for more info.
$35 USD in 3 Tagen
0,0 (0 Bewertungen)
0,0
0,0
8 Freelancer bieten im Durchschnitt $55 USD für diesen Auftrag
Avatar des Nutzers
Hi, I am C++ expert and can surely help you here, Thanks
$69 USD in 2 Tagen
4,8 (108 Bewertungen)
5,9
5,9
Avatar des Nutzers
Hi we are interested
$35 USD in 3 Tagen
5,0 (5 Bewertungen)
3,3
3,3
Avatar des Nutzers
It's like reinventing wheel, but I like it; I can do
$50 USD in 4 Tagen
0,0 (0 Bewertungen)
0,0
0,0
Avatar des Nutzers
I have over 5 years C++ programming experience and familiar with data structure and algorithms.
$45 USD in 1 Tag
0,0 (0 Bewertungen)
0,0
0,0
Avatar des Nutzers
Hi, I can do this pretty fast, and low costs.
$35 USD in 3 Tagen
0,0 (0 Bewertungen)
0,0
0,0
Avatar des Nutzers
Sounds like a fun little project. I can quickly deliver an efficient tested solution.
$35 USD in 1 Tag
0,0 (0 Bewertungen)
0,0
0,0
Avatar des Nutzers
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 in 7 Tagen
0,0 (0 Bewertungen)
0,0
0,0

Über den Kunden

Flagge von UNITED STATES
Clemson, United States
5,0
13
Mitglied seit Feb. 18, 2013

Kundenüberprüfung

Danke! Wir haben Ihnen per E-Mail einen Link geschickt, über den Sie Ihr kostenloses Guthaben anfordern können.
Beim Senden Ihrer E-Mail ist ein Fehler aufgetreten. Bitte versuchen Sie es erneut.
Registrierte Benutzer Veröffentlichte Jobs
Freelancer ® is a registered Trademark of Freelancer Technology Pty Limited (ACN 142 189 759)
Copyright © 2024 Freelancer Technology Pty Limited (ACN 142 189 759)
Vorschau wird geladen
Erlaubnis zur Geolokalisierung erteilt.
Ihre Anmeldesitzung ist abgelaufen und Sie wurden abgemeldet. Bitte melden Sie sich erneut an.