Jump to content

plz help me out to create binary tree

- - - - -

This topic has been archived. This means that you cannot reply to this topic.
11 replies to this topic

#1
kuki

kuki

    Newbie

  • Members
  • Pip
  • 5 posts
plz help me out to create binary tree that fetches data from database in php code
plz anyone give me logic

#2
WingedPanther

WingedPanther

    A spammer's worst nightmare

  • Moderators
  • 16,831 posts
Moved to the correct forum.

You will probably need to provide a few more details, since you are talking about a non-trivial activity.
Programming is a branch of mathematics.
My CodeCall Blog | My Personal Blog

#3
John

John

    Writes binary right handed and hex left handed

  • Moderators
  • 6,321 posts

WingedPanther said:

Moved to the correct forum.

You will probably need to provide a few more details, since you are talking about a non-trivial activity.

How is your binary/avl tree tutorial going?

#4
kuki

kuki

    Newbie

  • Members
  • Pip
  • 5 posts
i want to create the binary tree that fetches data from database
i'm working on multilevel marketing project.
i want to create binary tree that shows sponser and admin

#5
WingedPanther

WingedPanther

    A spammer's worst nightmare

  • Moderators
  • 16,831 posts

John said:

How is your binary/avl tree tutorial going?
I might finish that today.

kuki said:

i want to create the binary tree that fetches data from database
i'm working on multilevel marketing project.
i want to create binary tree that shows sponser and admin

A binary tree is a data storage object. It doesn't "fetch data", it "stores data". it sounds like you heard a buzz word and don't know what it is or when it is helpful. I would just use standard SQL and let the database handle storing your data. Also, a binary tree doesn't "show data". You need something else for that, like a table.
Programming is a branch of mathematics.
My CodeCall Blog | My Personal Blog

#6
John

John

    Writes binary right handed and hex left handed

  • Moderators
  • 6,321 posts
I believe most databases implement a b-tree structure.

#7
kuki

kuki

    Newbie

  • Members
  • Pip
  • 5 posts
actualy i'm working on multilevel marketing project. for that there are one root/admin and othes are affilates .so for that admin doesnt have more than one leg, leg must be right, left. and subordinate leg is also restricted to left and right. for that i want to show the subordinate name and id and generation of commision on complition of level. so i want to i that how should i fire the querry, and where ?

#8
WingedPanther

WingedPanther

    A spammer's worst nightmare

  • Moderators
  • 16,831 posts
I suspect you are working on a homework assignment, as what you are saying makes no sense outside of that context. A properly designed database will handle all this for you. What are you ACTUALLY trying to accomplish? Without knowing the details you are constrained by, we can't guide you.
Programming is a branch of mathematics.
My CodeCall Blog | My Personal Blog

#9
kuki

kuki

    Newbie

  • Members
  • Pip
  • 5 posts
sarika wrote:

i m making an MLM site in which a member can have two members under
himself,One member on left side and another on right side. Just like
binary tree . Now i want to trasverse through the tree using php and
mysql so that i can show the binary tree created this to user. Pls
suggested me best possible way to do it. Simply using sql queries
without joins and functions is very tedious and time consuming . so
plz suggest me shortest possible script which takes less execution
time.

#10
WingedPanther

WingedPanther

    A spammer's worst nightmare

  • Moderators
  • 16,831 posts
Do you know how this data will be stored in the database? You still need to read the data from the database into the tree.
Programming is a branch of mathematics.
My CodeCall Blog | My Personal Blog

#11
kuki

kuki

    Newbie

  • Members
  • Pip
  • 5 posts
i dont get what u r trying to tell

#12
WingedPanther

WingedPanther

    A spammer's worst nightmare

  • Moderators
  • 16,831 posts

kuki said:

plz help me out to create binary tree that fetches data from database in php code
plz anyone give me logic

Presumably you are storing your data in a database before you can fetch it into a binary tree. What format is it stored in? Also, how do you want it displayed? Sample data would be ideal.
Programming is a branch of mathematics.
My CodeCall Blog | My Personal Blog