Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 588
  • Last Modified:

Radix Exchange Sorts that sorts strings in C++

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';
          }
         ppt[j][STRING_SIZE-1]='\0';
     }
}

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


int main()
{
    srand(time(0));
    char array[ARRAY_SIZE][STRING_SIZE];
    generate(array);
    print(array);
    system("pause");
    return 0;
}
0
rhinez0rz
Asked:
rhinez0rz
1 Solution
 
rajeev_devinCommented:
cannot do your homework

check this link for help
http://en.wikipedia.org/wiki/Radix_sort
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now