Find Jobs
Hire Freelancers

Efficient Range-Set Storage

$30-70 USD

Completed
Posted almost 11 years ago

$30-70 USD

Paid on delivery
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
Project ID: 4577014

About the project

8 proposals
Remote project
Active 11 yrs ago

Looking to make some money?

Benefits of bidding on Freelancer

Set your budget and timeframe
Get paid for your work
Outline your proposal
It's free to sign up and bid on jobs
Awarded to:
User Avatar
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 days
0.0 (0 reviews)
0.0
0.0
8 freelancers are bidding on average $55 USD for this job
User Avatar
Hi, I am C++ expert and can surely help you here, Thanks
$69 USD in 2 days
4.8 (108 reviews)
5.9
5.9
User Avatar
Hi we are interested
$35 USD in 3 days
5.0 (5 reviews)
3.3
3.3
User Avatar
It's like reinventing wheel, but I like it; I can do
$50 USD in 4 days
0.0 (0 reviews)
0.0
0.0
User Avatar
I have over 5 years C++ programming experience and familiar with data structure and algorithms.
$45 USD in 1 day
0.0 (0 reviews)
0.0
0.0
User Avatar
Hi, I can do this pretty fast, and low costs.
$35 USD in 3 days
0.0 (0 reviews)
0.0
0.0
User Avatar
Sounds like a fun little project. I can quickly deliver an efficient tested solution.
$35 USD in 1 day
0.0 (0 reviews)
0.0
0.0
User Avatar
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 days
0.0 (0 reviews)
0.0
0.0

About the client

Flag of UNITED STATES
Clemson, United States
5.0
13
Member since Feb 18, 2013

Client Verification

Thanks! We’ve emailed you a link to claim your free credit.
Something went wrong while sending your email. Please try again.
Registered Users Total Jobs Posted
Freelancer ® is a registered Trademark of Freelancer Technology Pty Limited (ACN 142 189 759)
Copyright © 2024 Freelancer Technology Pty Limited (ACN 142 189 759)
Loading preview
Permission granted for Geolocation.
Your login session has expired and you have been logged out. Please log in again.