Find Jobs
Hire Freelancers

C++ class to enumerate sets

$30-75 USD

Concluído
Publicado há aproximadamente 17 anos

$30-75 USD

Pago na 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 do Projeto: 2951117

Sobre o projeto

6 propostas
Projeto remoto
Ativo há 17 anos

Quer ganhar algum dinheiro?

Benefícios de ofertar no Freelancer

Defina seu orçamento e seu prazo
Seja pago pelo seu trabalho
Descreva sua proposta
É grátis para se inscrever e fazer ofertas em trabalhos
Concedido a:
Avatar do Usuário
See private message.
$42,50 USD em 4 dias
4,9 (46 avaliações)
4,6
4,6
6 freelancers estão ofertando em média $34 USD for esse trabalho
Avatar do Usuário
See private message.
$29,75 USD em 4 dias
5,0 (73 avaliações)
4,1
4,1
Avatar do Usuário
See private message.
$33,15 USD em 4 dias
4,6 (7 avaliações)
3,4
3,4
Avatar do Usuário
See private message.
$25,50 USD em 4 dias
5,0 (8 avaliações)
1,6
1,6
Avatar do Usuário
See private message.
$29,75 USD em 4 dias
5,0 (3 avaliações)
0,8
0,8
Avatar do Usuário
See private message.
$42,50 USD em 4 dias
3,0 (1 avaliação)
1,1
1,1

Sobre o cliente

Bandeira do(a) UNITED STATES
Mountain View, United States
5,0
6
Membro desde out. 18, 2006

Verificação do Cliente

Obrigado! Te enviamos um link por e-mail para que você possa reivindicar seu crédito gratuito.
Algo deu errado ao enviar seu e-mail. Por favor, tente novamente.
Usuários Registrados Total de Trabalhos 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)
Carregando pré-visualização
Permissão concedida para Geolocalização.
Sua sessão expirou e você foi desconectado. Por favor, faça login novamente.