C++ Sorting Algorithms [closed]

Make one pass through the sequence to find the largest value, the second largest value, and the smallest value. Swap the largest to one end, the second largest to the other end, and the smallest to the middle. Voila: largest items are on the ends and the smallest is in the middle. Calling this a … Read more

print all possible strings of length p that can be formed from the given set [closed]

A possible approach could be to start from an empty string and add characters one by one to it using a recursive function and printing it. Here is my code: #include<stdio.h> #include<stdlib.h> #include<string.h> void print_string(char str[],char new_str[],int current_len,int n,int len) { /* str=orignal set, new_str=empty char array, current_len=0(Intially) n=no of elements to be used len=the … Read more