Write a function called removeDups
that takes an array of strings
and an integer length and removes all duplicate strings from the array.
Your function should make this example code work (assume you have a working printStrings
function handy):
string words[8] = {“boat”, “banana”, “train”, “boat”, “pterodactyl”, “boat”, “sausage”, “train”}; int len = 8; removeDups(words, len); printStrings(words, len); // should print: boat, banana, train, pterodactyl, sausage
Part A: Write the algorithm out in pseudo-code (simple english statements like “for each item in the array”).
Part B: Write the function.