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 393595
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T16:16:23+00:00 2026-05-12T16:16:23+00:00

By independent nodes, I mean that the returned set can not contain nodes that

  • 0

By independent nodes, I mean that the returned set can not contain nodes that are in immediate relations, parent and child cannot both be included. I tried to use Google, with no success. I don’t think I have the right search words.

A link, any help would be very much appreciated. Just started on this now.

I need to return the actual set of independent nodes, not just the amount.

  • 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-12T16:16:24+00:00Added an answer on May 12, 2026 at 4:16 pm

    You can compute this recursive function with dynamic programming (memoization):

    MaxSet(node) = 1 if "node" is a leaf
    MaxSet(node) = Max(1 + Sum{ i=0..3: MaxSet(node.Grandchildren[i]) },  
                           Sum{ i=0..1: MaxSet(node.Children[i])      })
    

    The idea is, you can pick a node or choose not to pick it. If you pick it, you can’t pick its direct children but you can pick the maximum set from its grandchildren. If you don’t pick it, you can pick maximum set from the direct children.

    If you need the set itself, you just have to store how you selected “Max” for each node. It’s similar to the LCS algorithm.

    This algorithm is O(n). It works on trees in general, not just binary trees.

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

Sidebar

Related Questions

I'm looking for independent industry reports that compare and contrast the various source control
I have a content type that references multiple nodes, and I need a way
Pattern of pub-sub events is that the publisher should not know or care if
I am working on a scientific application that has readily separable parts that can
I want subgraph clusterCG to have same rank as 3 (clusterCG schould not contain
is node.js a one process server, or can it emulate Apache bunch of child
I need an algorithm to find max independent set in a tree. I'm thinking
I'd like to make a draggable popup control, which is independent of its parent
Input: Graph G Output: several independent sets, so that the membership of a node
I have an independent contractor / freelancer helping with with some optimisation on a

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.