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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T17:32:23+00:00 2026-06-12T17:32:23+00:00

Now I have a string just including uppercases and lowercases. I want to change

  • 0

Now I have a string just including uppercases and lowercases. I want to change the string to the form that all the uppercases are behind the lowercases, and, the relative order of all the uppercases or the lowercases is not changed.

For example, a string “aAbBcCDd” changes to “abcdABCD”. A string “aaAAAbb” changes to “aabbAAA”.

if I define length of string an “N”, now I have an algorithm that is O(NlogN). But I want to know if there is an algorithm that costs smaller time. Of course , memory is limited too. The memory don’t depend on the Length is most fantastic.

Thank you very much!!!

  • 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-12T17:32:25+00:00Added an answer on June 12, 2026 at 5:32 pm

    Algorithm:

    Input: Your String in mixed lower and upper case

    Output: A String with lower case then upper case (relative order not changed)

    Create two temporary Strings
    String lower
    String upper
    
    loop over each character in your Input String
    
    if char is upper
       append to upper
    if char is lower
       append to lower
    
    return concatenation of lower + upper
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a string which contains only numbers. Now I want to remove all
Now I have a function that has to return a string. I saw a
assume I have a string 1,2,3,4 Now I want to replace, e.g. the 3rd
I have a string of below type. [test1,3,(257,305,435,900)] Now i want to split this
I have a textbox that allows a user to specify a search string, including
I have a string like the following: String str = 4*5; Now I have
I have a string String mainString=///BUY/SELL///ORDERTIME///RT///QTY///BROKERAGE///NETRATE///AMOUNTRS///RATE///SCNM///; Now I have another strings String str1= RT;
I have a string array in C named args[] - now how can I
Right now I have double numba = 5212.6312 String.Format({0:C}, Convert.ToInt32(numba) ) This will give
I have this string stored in a variable: IN=bla@some.com;john@home.com Now I would like 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.