Ad

Friday, 19 July 2013

Algo#49: Sort the input character array based on the given dictionary order.

Sort the input character array based on the given dictionary order.

E.G. If input word is “SHEEP“, sorting will make it as “EEHPS“.

But in the given dictionary, E may not be at first. As per the dictionary in given problem, if P is first, S followed and E later and finally H.

Then sorted array should be “PSEEH“.

Following is implementation of above problem in c language.





Please write comments if you find anything wrong or you want to add something more related to this topic.

No comments:

Post a Comment

Write your comment here.

Ad