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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T15:06:48+00:00 2026-05-12T15:06:48+00:00

Basic idea is to sort the strings and compare signature of strings, where signature

  • 0

Basic idea is to sort the strings and compare signature of strings, where signature is the alphabetically sorted string.

What would be the efficient algorithm to do so ?

  • 1 1 Answer
  • 1 View
  • 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-12T15:06:48+00:00Added an answer on May 12, 2026 at 3:06 pm

    If you are sorting the UTF8 characters “alphabetically”, you can convert them to 32-bit integers (UTF8 chars are 1 to 4 8-bit values) and then do a RADIX sort. It will work in O(N) time. If you were using just ASCII, I would suggest Counting Sort.

    There are many ways to match the signatures but I would use a Hash Table ( O(1) on average ) or a O(Lg N) structure such as Red-Black Trees or Skip-Lists.

    To further speed up your string matching, you can compress these signatures by Run Length Encoding these UTF8 characters (since they’re sorted, the signature will be runs + gaps). Actually, you could compress them to use bit tags that represent 7-bit chars (most common), RLE runs, and longer literals (8-bit through 32-bit chars). Comparing the compressed strings would be faster.

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

Sidebar

Related Questions

I understand the basic idea of java's String interning, but I'm trying to figure
The basic idea is to enable the selectManyCheckbox when the selectBooleanCheckbox is not checked
the basic idea is that you have some class that has a reference type
I have basic idea on Kilo Virtual Machine on Mobiles , I have clear
I have some basic idea on how to do this task, but I'm not
I understand (I think) the basic idea behind RESTful-ness. Use HTTP methods semantically -
I'm trying to implement anti-aliased pixel rendering. My basic idea is to render 4
I have a basic implementation of alpha-beta pruning but I have no idea how
I have tried to write a basic merge sort in PHP involving a small
This is just a basic print a sentence array string. I am new to

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.