Question
C++ Write a function called deleteRepeats that has a partially filled array of strings as a formal parameter and that deletes all repeated strings from
C++ Write a function called deleteRepeats that has a partially filled array of strings as a formal parameter and that deletes all repeated strings from the array. Since a partially filled array requires two arguments, the function will actually have two formal parameters: an array parameter and a formal parameter of type int that gives the number of array positions used. When a string is deleted, the remaining letters are moved forward to fill in the gap. This will create empty positions at the end of the array so that less of the array is used. Since the formal parameter is a partially filled array, a second formal parameter of type int will tell how many array positions are filled. This second formal parameter will be a call-by-reference parameter and will be changed to show how much of the array is used after the repeated letters are deleted. Hint: you Can use array[i].empty() to check if an array element is empty. Also, do not worry about punctuation after words. Original array: spicy jalapeno bacon tongue chicken, pork filet mignon strip steak cow ham hock. beef pancetta cupim meatball jowl venison. pastrami pork short loin chuck sausage leberkas pork chop prosciutto ribeye chicken jowl fatback andouille. ground round drumstick short ribs meatball turkey chuck rump beef flank leberkas landjaeger t-bone alcatra sausage chicken. shoulder hamburger landjaeger swine tail, chicken salami beef ribs kevin ground round ham turkey alcatra tenderloin. bacon turkey jerky boudin doner, jowl brisket porchetta pork capicola. cow burgdoggen fatback ball tip porchetta chicken picanha filet mignon. porchetta pancetta strip steak rump swine. leberkas sausage tenderloin spare ribs beef ribs, biltong swine chicken. shank ham hock t-bone, short loin short ribs turkey tenderloin brisket alcatra turducken pork loin bresaola cupim rump. ham meatball tri-tip pastrami, ribeye shank chicken corned beef tbone turkey leberkas porchetta cupim frankfurter. drumstick biltong pig, kevin brisket tenderloin shank landjaeger capicola. tri-tip jowl pancetta rump ground round filet mignon doner ribeye porchetta. porchetta ribeye pork chop, bacon tri-tip kielbasa prosciutto beef hamburger filet mignon picanha. cupim turducken corned beef tail filet mignon, salami pork belly leberkas spare ribs meatball pork chop jowl. tri-tip pork landjaeger, tongue andouille brisket chicken bresaola pancetta. fatback bresaola buffalo, chuck rump turkey filet mignon beef ham hock sausage. turkey strip steak beef ribs shank t-bone. shankle short loin spare ribs pork chop bresaola, ham hock picanha cow rump filet mignon pastrami tongue. rump buffalo pancetta, landjaeger filet mignon spare ribs chuck beef biltong. ham hock rump tri-tip alcatra, kevin swine hamburger porchetta sausage pork venison drumstick. pig cupim shankle beef tenderloin meatball jerky leberkas bresaola ham hock sausage salami. Original array size = 268 Reduced array: spicy jalapeno bacon tongue chicken, pork filet mignon strip steak cow ham hock. beef pancetta cupim meatball jowl venison. pastrami short loin chuck sausage leberkas chop prosciutto ribeye chicken fatback andouille. ground round drumstick ribs turkey rump flank landjaeger t-bone alcatra chicken. shoulder hamburger swine tail, salami kevin tenderloin. jerky boudin doner, brisket porchetta capicola. burgdoggen ball tip picanha mignon. swine. tenderloin spare ribs, biltong shank hock t-bone, turducken bresaola rump. tri-tip pastrami, corned frankfurter. pig, doner porchetta. chop, kielbasa picanha. tail mignon, belly jowl. landjaeger, andouille pancetta. buffalo, sausage. tbone. shankle bresaola, tongue. buffalo pancetta, biltong. alcatra, venison drumstick. pig salami. Reduced array size = 102
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started