Find Jobs
Hire Freelancers

C++ class to enumerate sets

$30-75 USD

Terminado
Publicado hace alrededor de 17 años

$30-75 USD

Pagado a la entrega
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 del proyecto: 2951117

Información sobre el proyecto

6 propuestas
Proyecto remoto
Activo hace 17 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
See private message.
$42,50 USD en 4 días
4,9 (46 comentarios)
4,6
4,6
6 freelancers están ofertando un promedio de $34 USD por este trabajo
Avatar del usuario
See private message.
$29,75 USD en 4 días
5,0 (73 comentarios)
4,1
4,1
Avatar del usuario
See private message.
$33,15 USD en 4 días
4,6 (7 comentarios)
3,4
3,4
Avatar del usuario
See private message.
$25,50 USD en 4 días
5,0 (8 comentarios)
1,6
1,6
Avatar del usuario
See private message.
$29,75 USD en 4 días
5,0 (3 comentarios)
0,8
0,8
Avatar del usuario
See private message.
$42,50 USD en 4 días
3,0 (1 comentario)
1,1
1,1

Sobre este cliente

Bandera de UNITED STATES
Mountain View, United States
5,0
6
Miembro desde oct 18, 2006

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.