Radix Exchange Sorts that sorts strings in C++

Posted on 2006-05-18
Last Modified: 2008-03-06
I need an implementation of radix sort that works for strings in c++.
This is what I am using to generate the string randomly.

#include <iostream>
#include <cstdlib>
#define STRING_SIZE 11
#define ARRAY_SIZE 10

using std::cout;
using std::endl;

void generate(char ppt[][STRING_SIZE])
     for (int j=0; j<ARRAY_SIZE;j++)
          for(int i =0; i<STRING_SIZE-1;i++)
                  ppt[j][i] = rand()%2 + 'A';

void print(char ppt[ARRAY_SIZE][STRING_SIZE])
    for(int i=0; i<ARRAY_SIZE; i++)
              cout << "ppt[" << i << "] = " << ppt[i] << endl;

int main()
    char array[ARRAY_SIZE][STRING_SIZE];
    return 0;
Question by:rhinez0rz
    1 Comment
    LVL 12

    Accepted Solution

    cannot do your homework

    check this link for help

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    What Should I Do With This Threat Intelligence?

    Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

    Often, when implementing a feature, you won't know how certain events should be handled at the point where they occur and you'd rather defer to the user of your function or class. For example, a XML parser will extract a tag from the source code, wh…
    Many modern programming languages support the concept of a property -- a class member that combines characteristics of both a data member and a method.  These are sometimes called "smart fields" because you can add logic that is applied automaticall…
    The viewer will be introduced to the technique of using vectors in C++. The video will cover how to define a vector, store values in the vector and retrieve data from the values stored in the vector.
    The viewer will be introduced to the member functions push_back and pop_back of the vector class. The video will teach the difference between the two as well as how to use each one along with its functionality.

    779 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    18 Experts available now in Live!

    Get 1:1 Help Now