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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T07:03:28+00:00 2026-06-13T07:03:28+00:00

Suppose there exists a tree where each node of the tree is either white

  • 0

Suppose there exists a tree where each node of the tree is either white or black, and for each internal node, its children are the opposite colour of that internal node. So if the tree were sketched, it would have the “top level” consist of (say) a black node, then the next level all white nodes, then the next level all black nodes, and so on.

Does any algorithm exist that, given a tree with root x, can check whether or not that tree meets these criteria?

  • 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-06-13T07:03:30+00:00Added an answer on June 13, 2026 at 7:03 am

    Yes. A recursive depth-first traversal should do this fairly easily. Put a method on each node which checks that all of its children are of different color, and that all of its children return true when this checker function is called on them.

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

Sidebar

Related Questions

Suppose there exists a type T such that std::is_trivially_destructable<T>::value == true , and suppose
Suppose there exists a workflow service A. WF A may have more than a
Suppose there are ~10,000's of keys, where each key corresponds to a stream of
Suppose there exists a function which returns a message say of the following format:
I am curious to know if there exists an architecture that is quicker for
Lets suppose there is a stored procedure that has 3 params. Out of all
Suppose there is a script sth.py When i logged with 'root' account. type :
Suppose there is a situation like : statement 1; statement 2; statement 3; statement
Suppose there are two lists a = {a1, a2, a3} and b = {b1,
Suppose there is an image_url column in database. I want the user to choose

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.