Win a copy of Pipeline as Code this week in the Cloud/Virtualization forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Rob Spoor
  • Henry Wong
  • Liutauras Vilda
Saloon Keepers:
  • Tim Moores
  • Carey Brown
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
Bartenders:
  • Frits Walraven
  • Himai Minh
  • Jj Roberts

how to replace a local root and on of its leefs

 
Ranch Hand
Posts: 191
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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??
 
Bartender
Posts: 9625
16
Mac OS X Linux Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
author
Posts: 14112
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 9625
16
Mac OS X Linux Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 ]
 
Rancher
Posts: 3742
16
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
so did i write it ok??


i dont know how to actually replace two objects in a tree
 
Marshal
Posts: 72441
315
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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?
 
The harder you work, the luckier you get. This tiny ad brings luck - just not good luck or bad luck.
SKIP - a book about connecting industrious people with elderly land owners
https://coderanch.com/t/skip-book
reply
    Bookmark Topic Watch Topic
  • New Topic