Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3439046
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T08:15:39+00:00 2026-05-18T08:15:39+00:00

I happen to have a database with a table that holds all possible combination

  • 0

I happen to have a database with a table that holds all possible combination of subject, verbs and complements possible.

That table looks like a junction table with Id columns mapping to my other tables (subject table, verbs table, complements table).

In my program I use a tree structure to represent the junction table and each node is therefore just an object with an Id property (subjectId or verbId …).

What I fail to understand though is where to put the actual data the Id maps to. I though I had two options:

  1. Make the Data a property of each Node
  2. Make the Data a node

In the first case the only processing I do is to load the combination table and create the tree. And when I need the data that goes with it, I load it on demand. But to keep track of the data position in the tree, the data has a property that points back to the node it belongs to.( a hack evidently to avoid having to search the whole tree (even if it is only a O(log(n)) operation). In addition,I will only be dealing with a node in the whole program since it is a convenient way to get to the children of then node.

In the second case, if I was to make the actual data a Node , I would have to load all the data at once before consuming it. besides, I still need to create a copy of the data if the “node parent siblings” are using the same data.

Is there a clean way to achieve what I am trying to do?
Listed below is what I currently have

public class Node<Word>{

    public Word Data { get; set; }

    public Guid ID { get; set; }

    ..... // other necessary tree like stuff

}

public class Word
{
    public Node NodeItem { get; set; }
}

Or

public class Word : Node{}

I hope that the question is clear enough. let me know if you need more details and I will update the question with it.
Thank you.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-18T08:15:40+00:00Added an answer on May 18, 2026 at 8:15 am

    Searching in the tree which you are mentioning will not be O(logn) in any case because this tree is not a Binary Search Tree. It’s an Undirected graph , you can say so you need to search either by using BFS or DFS.

    if i am imaging your situation correctly then on UI , you have a tree suppose in a left panel of your window and on the right panel you want to show the details of the node.

    if this is the UI or your situation then

    i would say do not store data in the tree , load on demand i.e. when user select a node , then you will have the ID of that node ,fetch the data with the ID and display.

    this way , you can avoid the possible loading of all data which may not be require at once .

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

We have a database that contains information about time booked to projects. We have
I have a particularly difficult business constraint that I would like to enforce at
I have a MySQL database of newspaper articles. There's a volume table, an issue
I have an ssis package that imports a view from one database into different
I have an app that uses a database. At startup I check to see
In my database I have certain data that is important to the functioning of
I have a database that is being accessed by a Silverlight application. It has
I have a table called Subscriptions. I'd like to redirect any LINQ select from
Anyone happen to have a sample script for recursing a given directory in a
So What I'm essentially trying to do is have something happen 70% of the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.