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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T14:22:25+00:00 2026-06-17T14:22:25+00:00

Given a string, what an efficient way is there to return the N-th lowest

  • 0

Given a string, what an efficient way is there to

  • return the N-th lowest char in it (ASCII wise)?
  • return the N-th lowset char*s* in it?

I have thought of sorting N iteration with insertion sort, or sorting quick sort, where the pivot is in the N-th position, but I had problem analyzing time complexity. Is there any other, more efficient way?

What will be the solution is it wasn’t a string, but a list of decimals?

  • 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-17T14:22:27+00:00Added an answer on June 17, 2026 at 2:22 pm

    If your strings are ASCII, you can do it using a counting-sort style algorithm. Make an array of 256 counters, go through the string, and increment a counter for each character’s code that you find in the string. Now walk the array from zero, accumulating the counts that you’ve seen so far. When adding a counter for character ch causes your accumulated result cross over N, you know that ch is the n-th character if the string were sorted. This algorithm is O(N), where N is the number of characters in your string. This is the time that it takes to build the array of counts.

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

Sidebar

Related Questions

Is there a more efficient way to achieve this: Given an array A of
I've been looking for a way to hash a given string in C# that
I have used the crypt function in c to encrypt the given string. I
How to find the below pattern is there or not in a given string
I would like to find an efficient way (not scanning the String 10,000 times,
I'm given a string hex_txt containing a 4 digit hex number in the way
I thought that this is the most efficient way to concatinate strings new StringBuilder(s1.length()
Is there a way for a memory efficient ID generation of an URL? At
I am searching a more efficient way to sum-up the ASCII values of all
For example, there is a given string which is consisted of 1s and 0s

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.