Find Jobs
Hire Freelancers

Efficient Range-Set Storage

$30-70 USD

Đã hoàn thành
Đã đăng vào gần 11 năm trước

$30-70 USD

Thanh toán khi bàn giao
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
Mã dự án: 4577014

Về dự án

8 đề xuất
Dự án từ xa
Hoạt động 11 năm trước

Bạn muốn kiếm tiền?

Lợi ích khi chào giá trên Freelancer

Thiết lập ngân sách và thời gian
Nhận thanh toán cho công việc
Phác thảo đề xuất của bạn
Miễn phí đăng ký và cháo giá cho công việc
Đã trao cho:
Avatar người dùng
I will be able to do this for you quickly and with high quality. Please check my PM for more info.
$35 USD trong 3 ngày
0,0 (0 nhận xét)
0,0
0,0
8 freelancer chào giá trung bình $55 USD cho công việc này
Avatar người dùng
Hi, I am C++ expert and can surely help you here, Thanks
$69 USD trong 2 ngày
4,8 (108 nhận xét)
5,9
5,9
Avatar người dùng
Hi we are interested
$35 USD trong 3 ngày
5,0 (5 nhận xét)
3,3
3,3
Avatar người dùng
It's like reinventing wheel, but I like it; I can do
$50 USD trong 4 ngày
0,0 (0 nhận xét)
0,0
0,0
Avatar người dùng
I have over 5 years C++ programming experience and familiar with data structure and algorithms.
$45 USD trong 1 ngày
0,0 (0 nhận xét)
0,0
0,0
Avatar người dùng
Hi, I can do this pretty fast, and low costs.
$35 USD trong 3 ngày
0,0 (0 nhận xét)
0,0
0,0
Avatar người dùng
Sounds like a fun little project. I can quickly deliver an efficient tested solution.
$35 USD trong 1 ngày
0,0 (0 nhận xét)
0,0
0,0
Avatar người dùng
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 trong 7 ngày
0,0 (0 nhận xét)
0,0
0,0

Về khách hàng

Cờ của UNITED STATES
Clemson, United States
5,0
13
Thành viên từ thg 2 18, 2013

Xác thực khách hàng

Cảm ơn bạn! Chúng tôi đã gửi email chứa đường link để bạn lấy tín dụng miễn phí.
Đã xảy ra lỗi trong khi gửi email của bạn. Hãy thử lại.
Người Dùng Đã Đăng Ký Tổng Số Việc Đã Đăng
Freelancer ® is a registered Trademark of Freelancer Technology Pty Limited (ACN 142 189 759)
Copyright © 2024 Freelancer Technology Pty Limited (ACN 142 189 759)
Đang tải xem trước
Đã cấp quyền truy cập vị trí.
Phiên đăng nhập của bạn đã hết hạn và bạn đã bị đăng xuất. Hãy đăng nhập lại.