Find Jobs
Hire Freelancers

C++ class to enumerate sets

$30-75 USD

Завершено
Опублікований about 17 years ago

$30-75 USD

Оплачується при отриманні
The project is building an object which returns all enumerated n-sized subsets of a vector. Calling next should go to next lexicographically ordered unique subset. These subsets are represented as vectors of iterators of the original type. The original ContainerT is a std::vector. Construction should be O(N), and next should be O(N). Constructor should throw exception if set_size > [login to view URL](). template class enumerated_subset { public: typedef typename ContainerT::iterator container_iter_type ; typedef typename std::vector subset_type ; enumerated_subset ( std::size_t set_size, ContainerT & container ) ; bool next ( ) ; /// Return true so long as not last iteration subset_type const & current ( ) const ; /// return reference to local current subset state private: subset_type current_subset; ContainerT * mp_container; } ; Ex. If there is a vector container elements : [0,1,2,3,4]. An enumerated subset class of size 1, would have 5 different values of current vector of iterators, after which operator++ would return false. Those iterations the values would pointer to : [0],[1],[2],[3],[4] If this were created with subsets of size 2. It would be : [0,1],[0,2],[1,2],[0,3], [1,3],[2,3],[0,4],[1,4],[2,4],[3,4] If this were created with subsets of size 3. It would be: [0,1,2], [0,1,3], [0,2,3], [1,2,3], [0,1,4],[0,2,4],[0,3,4], [1,2,4], [1,3,4], [2,3,4] If you draw these out in a table with the pattern will become obvious to you ( I hope ). The sets closer to the beginning of the series are more tightly coupled to the lower iterators. The project also requires that you write a small program that uses this type to print out the above examples, and extend it for sets of size 3, 4, and 5. This must be platform independenct C++ code, only C++ standard headers and STL headers are allowed. In the example code please use iostream. ## Deliverables 1) Complete and fully-functional working program(s) in executable form as well as complete source code of all work done. 2) Deliverables must be in ready-to-run condition, as follows (depending on the nature of the deliverables): a) For web sites or other server-side deliverables intended to only ever exist in one place in the Buyer's environment--Deliverables must be installed by the Seller in ready-to-run condition in the Buyer's environment. b) For all others including desktop software or software the buyer intends to distribute: A software installation package that will install the software in ready-to-run condition on the platform(s) specified in this bid request. 3) All deliverables will be considered "work made for hire" under U.S. Copyright law. Buyer will receive exclusive and complete copyrights to all work purchased. (No GPL, GNU, 3rd party components, etc. unless all copyright ramifications are explained AND AGREED TO by the buyer on the site per the coder's Seller Legal Agreement). ## Platform Platform independent, g++ compiled code that runs on a gcc 4.0 or greater release.
ID проекту: 2951117

Про проект

6 пропозицій(-ї)
Дистанційний проект
Активність 17 yrs ago

Хочете заробити?

Переваги подання заявок на Freelancer

Вкажіть свій бюджет та терміни
Отримайте гроші за свою роботу
Опишіть свою пропозицію
Реєстрація та подання заявок у проекти є безкоштовними
Доручений:
Аватарка користувача
See private message.
$42,50 USD за 4 дні(-в)
4,9 (46 відгуки(-ів))
4,6
4,6
6 фрілансерів(-и) готові виконати цю роботу у середньому за $34 USD
Аватарка користувача
See private message.
$29,75 USD за 4 дні(-в)
5,0 (73 відгуки(-ів))
4,1
4,1
Аватарка користувача
See private message.
$33,15 USD за 4 дні(-в)
4,6 (7 відгуки(-ів))
3,4
3,4
Аватарка користувача
See private message.
$25,50 USD за 4 дні(-в)
5,0 (8 відгуки(-ів))
1,6
1,6
Аватарка користувача
See private message.
$29,75 USD за 4 дні(-в)
5,0 (3 відгуки(-ів))
0,8
0,8
Аватарка користувача
See private message.
$42,50 USD за 4 дні(-в)
3,0 (1 відгук)
1,1
1,1

Про клієнта

Прапор UNITED STATES
Mountain View, United States
5,0
6
На сайті з жовт. 18, 2006

Верифікація клієнта

Дякуємо! Ми надіслали на вашу електронну пошту посилання для отримання безкоштовного кредиту.
Під час надсилання електронного листа сталася помилка. Будь ласка, спробуйте ще раз.
Зареєстрованих користувачів Загальна кількість опублікованих робіт
Freelancer ® is a registered Trademark of Freelancer Technology Pty Limited (ACN 142 189 759)
Copyright © 2024 Freelancer Technology Pty Limited (ACN 142 189 759)
Завантажуємо для перегляду
Дозвіл на визначення геолокації надано.
Ваш сеанс входу закінчився, і сеанс було закрито. Будь ласка, увійдіть знову.