All Questions
29 questions
3
votes
1
answer
367
views
High performance 3 Way Quick Sort Implementation
My implementation of 3 way quick sort for strings.
It supposed to sort very large set of 800,000,000 objects.
This is why I added ...
2
votes
2
answers
166
views
Function to find substring in a list of strings and add them to the resulting list
I am trying to look for a substring in a list of strings. My end result is an array that contains the presence of substring first based on course.name and then ...
1
vote
2
answers
330
views
Sorting string with if-else
I was asked to write a program that sorts three strings alphabetically using only if-else (no sorting algorithms, usage of arrays whatsover). I'm fairly new to C++ programming but I've come up with ...
1
vote
1
answer
252
views
Bubble sort in C (for strings)
What do you think of this bubble sorting function in C, for a string array? I would like to improve the readability, performance, and any good practices.
...
2
votes
1
answer
208
views
Sort an array of strings using bubble sort
I have this following code to sort an array of strings order by ASCII value (alphabetically) using bubble sort.
...
5
votes
2
answers
622
views
Computing word-frequency-table
I got a word count assignment and the requirements are shown below:
INPUT
The input contains words in several lines and in each line
there could be more than one word. The input only contains ...
4
votes
5
answers
2k
views
Sort string's characters into alphabetic order
Any improvements that I can make with this code?
Also, is there another way to convert a vector to a string variable without using a for ranged-based loop? From the posts I've seen for converting, I ...
12
votes
3
answers
9k
views
Return characters in a string in alphabetical order
Problem
Take a string and return all input characters in alphabetical order
Assume that no numbers or punctuation will be used
For the same character, uppercase characters should be returned ...
3
votes
1
answer
11k
views
Sorting an array of strings in C using insertion sort
I am a Java programmer who has C this semester. Needless to say, my writing style is heavily influenced by Java, which is probably not a great thing. I'd be grateful for a few nudges in the right ...
4
votes
1
answer
234
views
Sorting a long string with a composite of strings and integers + symbols
The code below is to sort a file containing the following info (eg. input.txt):
...
12
votes
3
answers
6k
views
Natural Order Comparator
I've been looking for an implementation of Comparator that provides a "natural order". I found a couple but they were buggy or poorly designed. I wrote my own with ...
1
vote
1
answer
2k
views
Sorting array of strings in c
Is there a simpler way with a simpler notation to do the following part of code:
...
8
votes
3
answers
3k
views
Word-counting script in C#
My goal is to read from standard input, break up the input into words (Unicode letters and apostrophes), case-insensitively, and produce a report to standard output, where each line is a word followed ...
2
votes
2
answers
114
views
Implementing a Sort for an Array
Yesterday, I gave an interview after a long time, and I was asked a question which I couldn't solve on the spot.
I had to implement a sort function for a Array of strings in JavaScript, with the ...
2
votes
1
answer
9k
views
Sorting the array of strings on their lengths in Java , Using Maps, ascending order....
I wrote the java method to answer this question :
Write a Program to sort String on their length in Java? Your method should accept an array of String and return a sorted array based upon the length ...