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

  • SEARCH
  • Home
  • 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 7556579
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T11:53:38+00:00 2026-05-30T11:53:38+00:00

I have a user and group database. There are a lot of groups on

  • 0

I have a user and group database. There are a lot of groups on the database and each group has a lot of member. For example;

  • User1 is member of Group1, Group2, Group3
  • User2 is member of Group2
  • User3 is member of Group2, Group5

There is a parent-child relationship among the groups. Parent groups are more general groups. For example,

  • Group2: Programmers
  • Group5: .NET Programmers

On the database, there is no parent-child relationship among the groups. How can create dynamic parent-child relationship? I there any algorithm about these problem?

Thanks for reply.

  • 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-30T11:53:40+00:00Added an answer on May 30, 2026 at 11:53 am

    Iterate through every item, filling table child1Parent2[groups,groups]. At start it is full of trues. For every group check condition: g1 is set and g2 is not set. If it is true, set false to chuld1Parent2[gr1,gr2]. At the end of iteration you have the table wich contains all parent-child info.

    boolean child1Parent2[groups,groups];
    for( g1:groups) for(g2:groups) {
        child1Parent2[g1,g2]=true;
    }
    for (itemRow:rows){
        for( g1:groups) for(g2:groups)
            if (child1Parent2[g1,g2])
            if (itemRow.contains(g1)& !itemRow.contains(g2))
                child1Parent2[g1,g2]=false;
    }
    

    As a result you have: child1Parent2[g1,g2] === (g1 is a child of g2)

    A piece of advice for future: if you want to find some info, think about how this info will be declared, what structure could it have. You’ll understand much more on the subject.

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

Sidebar

Related Questions

I have a MySQL database in which each user has an account, and each
I have Group and each group has contacts associated with it. When a user
I have a user document which has a group field. This field is an
I have Flex application requiring to filter users depending on there database groups. Depending
Say I have two tables, users and groups each of which has an auto-incrementing
Is it possible to have multiple backend user group access lists in Typo3? For
I have three models: User Image Group . User belongs to an image; Group
I created 3 tables: User User-Group Group Where I can have a many-to-many relationship.
how can I modify the user:group ownership of a s3fs mounted bucket? I have
I have just created a new project with a many-to-many relation (User-Group) and 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.