Relative Content

Tag Archive for c++algorithmsorting

Reworking the sorting algorithm for a three-dimensional array

Good evening. It’s been a few days since I’ve been able to convert this algorithm to sort a three-dimensional array. It should sort P two-dimensional matrices by columns “through” the whole array, not each column separately. The whole program code would not fit here, so I attach a small demo version. The algorithm for the vector is working, there are no errors in it. Can anyone help me? I sincerely do not understand what can be the error. Thank you for your time.

Rework the sorting algorithm

it’s embarrassing to ask this, but please could you help me adapt this algorithm to a two-dimensional array, so that it sorts the whole matrix across columns? This is an assignment from my university, the deadline is tomorrow and I can’t get anything done. Thank you for your time.

How to sort an array of strings with different length properly

I have a question about sorting with C#. I want to implement a function to sort an array of strings such as [“AA”, “A”, “Z”, “ZZZ”] alphabetically without any built-in sort methods. I have tried some Compare function and my logic which is comparison between each character of the two strings, but it does not work properly.

std::sort segmentation fault with custom structs [duplicate]

This question already has answers here: Why is the phrase: “undefined behavior means the compiler can do anything it wants” true? (2 answers) Consistency of undefined behavior for a fixed compiler (2 answers) Closed 1 min ago. This sounds like a duplicate question to Sorting a Vector of a custom class with std::sort() causes a […]