Find Jobs
Hire Freelancers

easy java project

$30-5000 USD

Terminado
Publicado hace casi 22 años

$30-5000 USD

Pagado a la entrega
Any tree can be transformed into a binary (here "binary" means that every node has at most two children) tree by first deleting from each node all the links to its children except the link to its leftmost child, and then setting a link from each node to its immediate right sibling. a) Write a procedure which takes a tree as input and produces its corresponding binary tree. The input tree is given by listing, for every node, the children of that node. Nodes are represented by integers. For example, the following representation: 1 2 3 4 5 2 6 3 7 8 denotes a tree having a root 1 with children 2,3,4 and 5; node 2 has one child, i.e., node 6; node 3 has children 7 and 8. Leaves (nodes with no children) will not have a separate input line; they will merely appear on the child list of another node. For simplicity you may assume that the nodes of the tree will be input in level order. b) Let now T be a tree and F be the binary tree equivalent to T under the above transformation. Write a function that accepts F as input and returns the height of T. c) Write a procedure that accepts F and a node v and returns first all the descendants of v in T and then all the ancestors of v in T. The ancestors of v in T must be output with the following format: print the list of all the ancestors of v in F; in this list, mark the ancestors of v in T by appending an asterisk to each. To test your procedures, your main program should call all three procedures and print their results. Specifically, a) Call the first procedure to read in a tree and produce a binary tree. Following this, print out the newly created binary tree in both preorder and postorder. For listing purposes, consider the leftmost-child to be the left child and the right-sibling to be the right child of a node. As you know, a preorder and postorder listing uniquely identifies a binary tree. (You will probably wish to write separate auxiliary procedures to do the predorder and postorder listings.) b) Call the second function to determine the tree's height and print out the resulting value. c) Call the third procedure three times, once each with the nodes labeled 1, 2, and 3. Print the results for each of these 3 calls. ## 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. ## Platform UNIX needs to run from both the command line and an input file. For an experienced coder (5+ years), this will take you 15 minutes to complete. It would take me about 10 hours, and I don't have 10 hours to spare! ## Deadline information Must be finished by 7/26/02 12:00:00 PM. This is a very easy project that I do not have the time to work on. I have other projects more important to do. An experienced code will finish this in less than a half-hour. Bidding will close down early.
ID del proyecto: 2861977

Información sobre el proyecto

9 propuestas
Proyecto remoto
Activo hace 22 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.
$21,25 USD en 14 días
5,0 (60 comentarios)
5,0
5,0
9 freelancers están ofertando un promedio de $27 USD por este trabajo
Avatar del usuario
See private message.
$12,75 USD en 14 días
4,6 (26 comentarios)
4,4
4,4
Avatar del usuario
See private message.
$42,50 USD en 14 días
4,9 (69 comentarios)
4,2
4,2
Avatar del usuario
See private message.
$25,50 USD en 14 días
4,8 (9 comentarios)
3,3
3,3
Avatar del usuario
See private message.
$12,75 USD en 14 días
5,0 (3 comentarios)
3,0
3,0
Avatar del usuario
See private message.
$25,50 USD en 14 días
5,0 (2 comentarios)
0,7
0,7
Avatar del usuario
See private message.
$85 USD en 14 días
0,0 (0 comentarios)
0,0
0,0
Avatar del usuario
See private message.
$12,75 USD en 14 días
0,0 (0 comentarios)
0,0
0,0
Avatar del usuario
See private message.
$8,50 USD en 14 días
0,0 (0 comentarios)
0,0
0,0

Sobre este cliente

Bandera de UNITED STATES
United States
5,0
15
Miembro desde jul 11, 2002

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.