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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T16:01:08+00:00 2026-06-02T16:01:08+00:00

I understand how an AVL tree works with integers.. but I’m having a hard

  • 0

I understand how an AVL tree works with integers.. but I’m having a hard time figuring out a way to insert strings into one instead. How would the strings be compared?

I’ve thought of just using the ASCII total value and sorting that way.. but in that situation, inserting two identical ASCII words (such as “tied” and “diet”) would seem to return an error.

How do you get around this? Am I thinking about it in the wrong way, and need a different way to sort the nodes?

And no they don’t need to be alphabetical or anything… just in an AVL tree so I can search for them quickly.

  • 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-02T16:01:09+00:00Added an answer on June 2, 2026 at 4:01 pm

    When working with strings, you normally use a lexical comparison — i.e., you start with the first character of each string. If one is less than the other (e.g., with “diet” vs. “tied”, “d” is less than “t”) the comparison is based on that letter. If and only if the first letters are equal, you go to the second letter, and so on. The two are equal only if every character (in order) from beginning to end of the strings are equal.

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

Sidebar

Related Questions

I am implementing an AVL tree and trying to understand how template works so
I understand the the outline is used for accessibility but what's another way of
I understand this is somewhat trivial but... What the best way to get the
I'm looking for the best way to calculate a nodes balance in an AVL-tree
I understand this is an easy question but for some reason this just isn't
I understand what weak tables are. But I'd like to know where weak tables
I understand the way Mealy state machines work - the output logic is now
I understand that the CLR needs to do marshaling in some cases, but let's
I have a AVL tree data structure, where every node has its own lock.
Understand that the subject should be discussed before. But as I haven't found 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.