• Post Reply Bookmark Topic Watch Topic
  • New Topic

how to replace a local root and on of its leefs  RSS feed

 
alex lotel
Ranch Hand
Posts: 191
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
on a binary tree

so if there were in the start

abc >>> bac

i thout of the idea to store each of there data if a temporary
variables
and then put the data we want


but thats too easy
i think the question ment actualy spin them

any general ideas how to build this functions??
 
Joe Ess
Bartender
Posts: 9443
12
Linux Mac OS X Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
you should have a look at our FAQ, How To Ask Questions On JavaRanch especially the page Do Your Own Homework.
 
alex lotel
Ranch Hand
Posts: 191
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i want to solve this question
i dont know how to do it

how can i use FAQ to solve it
there is no way i'll find the solution there

FAQ is for general question like "how to start the debugger"

i cannot use it to solve this binary tree question
 
Ilja Preuss
author
Sheriff
Posts: 14112
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You are right that you won't find the solution in the FAQ. What you *will* find are quite good tips on how to prepare and phrase your question so that the chance that we are able and willing to help is magnificently increased.
 
Joe Ess
Bartender
Posts: 9443
12
Linux Mac OS X Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The FAQ won't give you the answer, but it will tell you what this community expects of you. We expect you to show some effort. If you don't like that rule, perhaps you should ask your instructor for advice. They will be better equipped to give you the correct amount of hinting without just giving the answer away.
That said, do you understand how a tree works? Do you have code for the tree nodes? Have you taken a stab at writing the swap function?
 
alex lotel
Ranch Hand
Posts: 191
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i know how a tree works i can write a code like

thats the only way i can think of

but thats too easy i think they want me
to acctually switch it "like t.next=t.next.next"
i dont know how to accomplish that
[ February 13, 2008: Message edited by: donaldth smithts ]
 
Joanne Neal
Rancher
Posts: 3742
16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you're not sure what the question means, then you need to ask your lecturer to clarify it. No one on here is going to know what your lecturer intended.
 
alex lotel
Ranch Hand
Posts: 191
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
in the moment i dont have any lecturer

lets solve both cases

did i solve the first case ok??

what about the second one, how do you advise me to do that??
 
alex lotel
Ranch Hand
Posts: 191
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
so did i write it ok??


i dont know how to actually replace two objects in a tree
 
Campbell Ritchie
Marshal
Posts: 56598
172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am afraid I can't understand the questions; I am not sure others can either. Please rephrase the question clearly, and show us some code. Please post such simple questions in the beginners' forum.

Have you got the thing about linked lists I commented about earlier to work yet?
 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!