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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T03:43:02+00:00 2026-06-18T03:43:02+00:00

I am constructing a binary search tree of size 7 and height 3. I

  • 0

I am constructing a binary search tree of size 7 and height 3. I only have to hard-code it, not generate it through a function.

This is the tree that I have hard-coded

Node (Node (Node (Empty, 0, Empty), 1, 
Node (Empty, 3, Empty)), 5
Node (Empty, 7, Node (8, 9, Empty))))

What I want is for Node 9 to have two children (8 and Empty). However, I keep on getting an error on 8 that says “this expression has type int but an expression of was expected of type int tree”. How can I correct this?

Thanks!

  • 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-18T03:43:03+00:00Added an answer on June 18, 2026 at 3:43 am

    The first element of a Node has to be a tree, not something else like an int.

    Therefore, you can’t put 8 in a place where a tree is expected. Probably, you meant to have Node (Empty, 8 Empty) instead of 8.

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

Sidebar

Related Questions

I am constructing a binary tree consisting of words from a sample paragraph, sorted
I'm constructing a generic binary tree which includes a struct, TreeNode. I implement a
The following code tries to create nodes of a binary tree and return a
I am constructing a search function in a class to be used by several
Im constructing an array of objects like this: var postData = []; $.each(selectedFields, function
I'm constructing an app and for that I have a function to fill it
When constructing a new object, I use the following code. In this code, is
I'm constructing an ecommerce application in Symfony, and I have a page which lists
I am having trouble constructing a jqGrid TreeGrid using local data. This method works
I have some data that is stored in a sorted vector. This vector is

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.