Question: -I need help with C++ . I'm working with an array of words . The array size is 1000 but not all 1000 slots will

-I need help with C++. I'm working with an array of words. The array size is 1000 but not all 1000 slots will be filled. I run an insertion sort algorithm and then output the array but the sorted array output includes the unused empty slots so there is a lot of blank spaces before the sorted words appear.

-The sorting algorithm seems to be reading in the empty array slots as well. Is there a way to read an array and only work with the non-empty slots? In other words, how do I filter out the array so that it will exclude the blanks? I can't be sorting and printing out the blank array slots, only the slots with a word on it.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!