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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T13:39:34+00:00 2026-06-01T13:39:34+00:00

I am constructing a binary tree consisting of words from a sample paragraph, sorted

  • 0

I am constructing a binary tree consisting of words from a sample paragraph, sorted alphabetically. So far, I have implemented all of the basic “behind the scenes” work to define the binary tree (constructors, methods), and I am now working on adding elements (words) to the tree.
Every word has had its non-alphanumeric characters removed and every letter in the word is converted to lowercase. I am wondering how I could enter words into the tree alphabetically? All I have done with binary trees have to do with numbers, so I am not sure what to do in this case. (I was thinking of something to do with ASCII values?)

  • 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-01T13:39:36+00:00Added an answer on June 1, 2026 at 1:39 pm

    You say you’ve done this with numbers before.

    Nothing has really changed with your new tree.

    You can think of an alphabetical comparison as just a way of giving something a precedence ranking over something else.

    So, think of these strings as being a number, the smaller the number, the lower level in the tree the string will occupy. You’re simply making your tree sort by smallest numbers first. A is smaller than B, B is smaller than C and so on.

    Check out this related question for coming up with a comparison function to give you the “numbers” you’re looking for.

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

Sidebar

Related Questions

I'm constructing a generic binary tree which includes a struct, TreeNode. I implement a
I am constructing a large HTML document from fragments supplied by users that have
I am constructing a combination chart from an ajax json object consisting of a
Given: Constructing an ADO Connection object from one thread and giving it to another
I have some data that is stored in a sorted vector. This vector is
//Constructing set of all Places in Conflict with each other int l_placeVec, l_placeVec1,p; for(SP_ListListNode::const_iterator
I'm constructing a program which uses mprotect() to restrict a block of memory from
I'm trying to construct a binary tree (unbalanced), given its traversals. I'm currently doing
The following code tries to create nodes of a binary tree and return a
Constructing scala.collection.Map from other collections, I constantly find myself writing: val map = Map(foo.map(x=>(x,

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.