Ad

Showing posts with label Sorting. Show all posts
Showing posts with label Sorting. Show all posts

Saturday, 20 July 2013

Algo#50: Find k element pairs out of given array which adds to SUM

Find k element pairs out of given array which adds to SUM

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.

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.

Ad