Find Jobs
Hire Freelancers

C++ problem w/ data structures

$20-25 USD

Fechado
Publicado há mais de 20 anos

$20-25 USD

Pago na entrega
A coal mine has collapsed, but we have a seismic picture of a vertical cross-section that shows where all the pockets that might contain workers [login to view URL] can drill shafts vertically from the ground to a pocket, or from an already-reached pocket to another pocket. Your program will calculate how many hours it will take to reach all the pockets. X indicates rock, while - indicates air space. Access within a pocket is limited to horizontal or vertical adjacency. Each shaft requires len hours to drill, where len is the length of the shaft. The shafts must be vertical, and they provide no horizontal access to adjacent pockets. We have only one drilling rig, so the two shafts cannot be drilled concurrently. Example: if the mine is shown on the left, then you should return 5. Mine Rescue Plan XXXXXXXXXXXX-XXXX--- XXXX|XXXXXXX-XXXX--- XXXX-XXXXX--------XX XXXX-XXXXX--------XX XXXXXXXXXXXXXXX--XXX XXXXXXXXXXXXXXX--XXX XXX-XXXX----------XX XXX-XXXX----------XX ---XX---XXXXXXXXXXXX ---|X---XXXXXXX|XXXX --------XXXXXXX--XXX --------XXXXXXX--XXX ---XXXXXXXXXXX--XXXX ---|XXXXXXXXXX--XXXX XX-XXXXX------------ XX-|XXXX------------ XXX-------XXXXXXXXXX XXX-------XXXXXXXXXX This mine has 4 separate air pockets (plus one which is exposed to the surface already). A solution is shown with | denoting a section of rock with a vertical shaft through it. One shaft goes from the exposed upper right pocket to the one in the lower right. Then a shaft of length 2 connects to the big pocket on the left. Notice that the vertical shaft in the next to bottom row does not provide access to the pocket on its left -- the shaft needs to be two sections long before it punches into the pocket above it. The remaining two tiny pockets are reached by shafts of length one, one down from the surface, and the other up from the left pocket. ## Deliverables 1) I need the problem solved with an efficient algorithm involving data structures so it will complete in a reasonable amount of time. 2)All lines of code must be commented. The program must be run from debug mode within Visual C++ Studio (6.0 or higher). 3) Please use------- public class Rescue{ public int howLong(vector mine) //pre: 1<=#mine<=50, all elements have the same length in 1..50 inclusive each character in each string is '-' or 'X' //post: how long it will take to reach all the pockets? ## Platform WindowsXP, Visual C++ Studio 6.0( or equiv)
ID do Projeto: 2963939

Sobre o projeto

4 propostas
Projeto remoto
Ativo há 21 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
4 freelancers estão ofertando em média $17 USD for esse trabalho
Avatar do Usuário
See private message.
$16,99 USD em 5 dias
5,0 (159 avaliações)
6,0
6,0
Avatar do Usuário
See private message.
$21,25 USD em 5 dias
5,0 (9 avaliações)
2,5
2,5
Avatar do Usuário
See private message.
$8,50 USD em 5 dias
5,0 (16 avaliações)
1,6
1,6
Avatar do Usuário
See private message.
$21,25 USD em 5 dias
0,0 (0 avaliações)
0,0
0,0

Sobre o cliente

Bandeira do(a) UNITED STATES
United States
5,0
2
Membro desde ago. 15, 2003

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.