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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T03:27:20+00:00 2026-06-01T03:27:20+00:00

So we have this problem that we are trying to figure out. Heres what

  • 0

So we have this problem that we are trying to figure out. Heres what the problem asks.
Lester has a list of words that he wants to print, not in the usual alphabetical order, but not in random order either. He decided on a method to sort the words that he calls AlphaFun order.
The AlphaFun order method sorts the words using the following procedure
1.first compare the 2nd letter of the words
2.then compare teh 4th letter of the words(the 4th letter will be considered to be a space in words containing less than 4 letters).
3.compare the last letter of the words (the last letter will always be the last letter of the word, not a space).
4.finally compare the first letter in the words.
5.if all of the above are the same characters, then the words used for those letters are sorted alphabetically.

note these examples
Words:

EGG

EGGS

BREAD

ALPHAFUN:

G SE

GSSE

RADB

Input
the input files contains and unkown number of lines, where each line of inputer contains a single word consisting of 3 to 10 letters.
output
you will print the words in alpha fun order

example input file:
BREAD
AERIE
BROAD
EGGS
EGG
WALLET

example output to screen
WALLET
AERIE
EGG
EGGS
BREAD
BROAD

how could we do this problem? we have been stuck on it for like 2 hours.

  • 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-01T03:27:22+00:00Added an answer on June 1, 2026 at 3:27 am

    how could we do this problem? we have been stuck on it for like 2 hours.

    Java makes this pretty easy, actually. You just need to implement Comparator<String> in a class, e.g.

    public class AlphaFunComparator implements Comparator<String> {
        public int compare(String o1, String o2) {
            // Implement rules described in the question
        }
    }
    

    Then you just need to load the file into a list, and call:

    Collections.sort(list, new AlphaFunComparator());
    

    Print out the list, and you’re done.

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

Sidebar

Related Questions

I have this little problem, that I cannot figure out which arguments to pass
I'm trying to figure out a Java regex problem that I'm having. This is
I have been trying to figure this problem out without asking for help, but
i've been trying to figure this out and i have absolutely no clue why
I have this problem that my sites uses alot of ajax and when a
Ok I have this problem that I've never had before, it's really bugging me.
I have this problem decomposing a relation schema into a set of schemas that
I have a problem that I can't resolve. Let's say I have this map
I'm working on a problem that uses pointer arithmetic and I have found this
I have this quite popular problem, but have failed to find a solution that

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.