Find Jobs
Hire Freelancers

C++ problem w/ data structures

$20-25 USD

Cerrado
Publicado hace más de 20 años

$20-25 USD

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

Información sobre el proyecto

4 propuestas
Proyecto remoto
Activo hace 21 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
4 freelancers están ofertando un promedio de $17 USD por este trabajo
Avatar del usuario
See private message.
$16,99 USD en 5 días
5,0 (159 comentarios)
6,0
6,0
Avatar del usuario
See private message.
$21,25 USD en 5 días
5,0 (9 comentarios)
2,5
2,5
Avatar del usuario
See private message.
$8,50 USD en 5 días
5,0 (16 comentarios)
1,6
1,6
Avatar del usuario
See private message.
$21,25 USD en 5 días
0,0 (0 comentarios)
0,0
0,0

Sobre este cliente

Bandera de UNITED STATES
United States
5,0
2
Miembro desde ago 15, 2003

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.