Find Jobs
Hire Freelancers

Train

$30-5000 USD

Concluído
Publicado há quase 22 anos

$30-5000 USD

Pago na entrega
We have a collection of train cars. We want to hook them together to get the train with the most cars possible. Some cars have a unique front end, and some can have either end in front. Two cars can be coupled together only if their coupling mechanisms are compatible. Each car is described by a string of uppercase letters. The front end is the end with the letter that comes first in the alphabet (if it starts and ends with the same letter, either end can be in front). Two words can be hooked together only if the two adjoining ends have the same letter. Create a class WordTrain that contains the method (function) hookUp that takes cars, a string[], and returns a string which is the longest word train that can be made from cars. DEFINITION: Class: WordTrain Method Signature: string hookUp(vectorcars); If more than one train of the longest lenght is possible, return the one that comes first in the aphabet. Remember that the length of a train is the number of cars, not the number of letters. The returned string should be all the cars in the train, starting at the front of the train, concatenated with '-' showing the coupling between adjacent cars. For alphabetic breaking of ties, the '-' is included in its usual order in the ascii sequence. Your method may assume the following preconditions are met: -cars contains between 1 and 50 elements -each element of cars contains only uppercase letters -each element of cars contains between 3 and 10 inclusive letters EXAMPLES (quotes shown for clarity only) 1) {"CBA", "DAA", "CXX"} : return "ABC-CXX" This is the only possible train of length 2. Note that CBA needed to be reversed so that it was facing the right direction. 2){"ACBA"}: return "ABCA" 3){"AUTOMATA", "COMPUTER", "ROBOT"}: return "COMPUTER-ROBOT" '-' sorts before uppercase letters ## Deliverables Complete and fully-functional working program(s) in executable form as well as complete source code of all work done. Complete copyrights to all work purchased. This code should be written using Microsoft Visual C++ 6.0, so that when I compile it I won't get errors or warnings related to compiler differences. I will be asking you why you did what you did, because I need to understand your logic. So either during or after you're done coding, you will need to explain me your algorithm. If you have further questions, pls email me. I need to have this program done by July 7. But I will need you to send me your pseudocode or algorithm before that. I also need a test (main) program to test the functions. Thanks :) ## Platform Windows 2000 NT, Visual C++ 6.0 ## Deadline information Please do not bid if you're not serious. I want to have an efficient algorithm by July 2, and you should respond to my emails if I have questions about your algorith/code. This project has been auctioned before and unfortunately the coder had dissappeared on me. So don't bid if you are not serious!
ID do Projeto: 2857664

Sobre o projeto

13 propostas
Projeto remoto
Ativo há 22 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.
$6 USD em 14 dias
5,0 (4 avaliações)
2,6
2,6
13 freelancers estão ofertando em média $33 USD for esse trabalho
Avatar do Usuário
See private message.
$42,50 USD em 14 dias
5,0 (35 avaliações)
5,0
5,0
Avatar do Usuário
See private message.
$25,50 USD em 14 dias
5,0 (60 avaliações)
5,0
5,0
Avatar do Usuário
See private message.
$68 USD em 14 dias
4,3 (38 avaliações)
5,0
5,0
Avatar do Usuário
See private message.
$42,50 USD em 14 dias
4,7 (41 avaliações)
4,7
4,7
Avatar do Usuário
See private message.
$38,25 USD em 14 dias
4,6 (60 avaliações)
4,5
4,5
Avatar do Usuário
See private message.
$42,50 USD em 14 dias
4,5 (17 avaliações)
3,3
3,3
Avatar do Usuário
See private message.
$8,50 USD em 14 dias
5,0 (12 avaliações)
1,9
1,9
Avatar do Usuário
See private message.
$12,75 USD em 14 dias
4,9 (5 avaliações)
1,8
1,8
Avatar do Usuário
See private message.
$21,25 USD em 14 dias
5,0 (5 avaliações)
1,1
1,1
Avatar do Usuário
See private message.
$85 USD em 14 dias
0,0 (2 avaliações)
0,0
0,0
Avatar do Usuário
See private message.
$8,50 USD em 14 dias
0,0 (0 avaliações)
0,0
0,0
Avatar do Usuário
See private message.
$24,65 USD em 14 dias
0,0 (1 avaliação)
0,0
0,0

Sobre o cliente

Bandeira do(a) UNITED STATES
United States
5,0
4
Membro desde jun. 14, 2002

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.