## Dynamic Array in C

Snow Howler is the librarian at the central library of the city of HuskyLand. He must handle requests which come in the following forms: 1 x y : Insert a book with y pages at the end of the xth shelf. 2 x y : Print the number of pages in the yth book on the xth shelf. 3 x : Print the number of books on the xth shelf. Snow Howler has got an assistant, Oshie, provided by the Department of Education. Although inexperienced, Oshie can handle all of the queries of types 2 and 3. Help

## Calculate the Nth term C

This challenge will help you learn the concept of recursion. A function that calls itself is known as a recursive function. The C programming language supports recursion. But while using recursion, one needs to be careful to define an exit condition from the function, otherwise it will go into an infinite loop. To prevent infinite recursion, if ... else statement (or similar approach) can be used where one branch makes the recursive call and other doesn't. void recurse() { .....

## Sorting Array of Strings C

To sort a given array of strings into lexicographically increasing order or into an order in which the string with the lowest length appears first, a sorting function with a flag indicating the type of comparison strategy can be written. The disadvantage with doing so is having to rewrite the function for every new comparison strategy. A better implementation would be to write a sorting function that accepts a pointer to the function that compares each pair of strings. Doing this will mean on

## Permutations of Strings C

Strings are usually ordered in lexicographical order. That means they are ordered by comparing their leftmost different characters. For example, abc < abd because c < d. Also z > yyy because z > y. If one string is an exact prefix of the other it is lexicographically smaller, e.g., gh < ghij. Given an array of strings sorted in lexicographical order, print all of its permutations in strict lexicographical order. If two permutations look the same, only print one of them. See the 'note' bel