473,406 Members | 2,356 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

class that will load the tree from the table

123 100+
Table below

id parent_id Node
1 0 Node 1
2 0 Node 2
3 1 Node 1.1
4 1 Node 1.2
5 2 Node 2.1

write a class that will load the tree from the table using below function

getChildNode(parent_node_id)
Returns an array of child nodes given an id of a parent node (parent_node_id)

getBreadcrumbs(node_id)
Returns an array of nodes, which make up a “path” to the node given a node_id

renderTree() Renders the tree

any advise?how to start? thanks
Jul 7 '08 #1
2 848
Curtis Rutland
3,256 Expert 2GB
Is this a homework question? It has the sound of a textbook question.
Jul 7 '08 #2
perhapscwk
123 100+
Is this a homework question? It has the sound of a textbook question.
It is a question from a interview.
Jul 7 '08 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: Zheng Da | last post by:
Will the following class work well? If it can not work correctly in some situation, could you help me to fix it? Thank you. //the class will work like the reference in java //when you create a...
1
by: Soul | last post by:
Hi, I have a DataGrid which works. But if I load a new table to the DataGrid, it will still show those old data I load earlier. private void loadTableA() { if ( openFileDialog.ShowDialog()...
6
by: chris | last post by:
Hi, I have a table in the database. I have a method which will return a table with the same structure as the DB one and with all data I need. What I want to do is to remove all data in the DB...
4
by: Andrzej Jaworek | last post by:
Hello, I have a "tree" table: Id - primary key ParrentId - (foreign key) related to Id Title ..... when I delete some record I want to delete it with all childs (cascade
1
by: smilecry | last post by:
I am trying to create a tree table (javascript code was adopted from online source) but the rowspan in td tag does not work well when I toggle the rows. Here is the sample code, notice the row "4"...
2
by: Mark S. | last post by:
Hello, I've put my question at the bottom of the code below... using System; using System.Collections.Generic; using System.Text; public class Criterion { public string operatorLogical;...
1
by: Mufasa | last post by:
Does anybody have any experience with a tree view control for winforms that will automatically load on demand (I could write it myself but why bother.) Just wondering which, if any of them, are...
1
by: never2lite | last post by:
Before this evening when I came home and found an odd page showing on my desktop, my pc ran okay...not great. It is a new emachine, only purchased it in 5/2010, but there have been issues with it. I...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.