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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T02:16:14+00:00 2026-06-16T02:16:14+00:00

my professor has asked to sort a 2d char array by column so the

  • 0

my professor has asked to sort a 2d char array by column so the attached array he wants sorted is

  unsorted          sorted last column
Lcekoeddhoffbmg     Balgfcaelhfkgeb
Lkcmggjcdhhglif     Kmlhmhcddfoeilc
Cgldjhcekjigcdd     Cgldjhcekjigcdd
Cgldjhcekjigcdn     Lkcmggjcdhhglif
Bffmdbkcenlafjk     Lcekoeddhoffbmg
Fggdijijegfblln     Jjlncnimjldfedj
Jjlncnimjldfedj     Bffmdbkcenlafjk
Amliglfohajcdmm     Amliglfohajcdmm
Balgfcaelhfkgeb     Fggdijijegfblln
Kmlhmhcddfoeilc     Cgldjhcekjigcdn

but the catch is that he wants the entire row to be the same characters so if we are sorting the last column we would just move the row up or down accordingly. i have no idea on how to even get this started any help would be much appreciated

  • 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-16T02:16:15+00:00Added an answer on June 16, 2026 at 2:16 am

    Assuming you know how to sort a 1d array (otherwise look it up), this is fairly similar.

    Instead of swapping two chars (when you use bubble sort or any other sorting algorithm based on swapping items), you swap the two complete rows.
    So you get something like this (for bubble sort):

    for char1 of each_last_row_char
      for char2 of each_last_row_char_after_char1
        if char2 < char2 then
          swap rows of char1 and char 2
        end
      end
    end
    

    Swapping complete rows is not that difficult as well. You iterate over the amount of items in the rows (assuming they have the same amount of chars), and swap the items of both rows:

    for index of row_items
      tmp = row1[index]
      row1[index] = row2[index]
      row2[index] = tmp
    end
    

    Just like a regular swap implementation, but then for all items.

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

Sidebar

Related Questions

My professor in the uni has asked me to design a simple website with
My professor has asked us to write a program that uses recursion to solve
I have two tables Department Professor in which Department has an attribute called HeadID
My professor has asks us to reimplement all of the LinkedList functions from scratch.
I am in a C++ class and my professor has given us some starter
My professor, (for some unexplained reason) wants to change all input-output files of our
Imagine a student and multiple professors A professor has many students The students go
Folks, my professor has assigned us an assignment involving typing with arrays, pointers, and
I'm working on an assignment, and my professor has given us the function prototypes
Im trying to make a simple 2D application, and our image processing professor has

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.