Question: [C PROGRAMMING] Please help fill out these two functions, I don't know how to do them. Some comments would be nice so I can understand
[C PROGRAMMING] Please help fill out these two functions, I don't know how to do them. Some comments would be nice so I can understand how you did it too. Thanks.
![[C PROGRAMMING] Please help fill out these two functions, I don't know](https://s3.amazonaws.com/si.experts.images/answers/2024/09/66e14feac123d_09066e14fea3f7fc.jpg)

For void differences, I have the ham and spam from the file here (just unzip it): https://www.dropbox.com/s/u8yj0basrnt59nv/smsspamcollection.zip?dl=0
int bagsearch( struct bag-struct *bow, char *word ); This function will perform a binary search of the "bag" array contained in the struct bag_struct pointed to by the pointer bow. The binary search should look in the middle of the array for the "word". If the "word" is alphabetically before the middle word in the "bow", then the search should be repeated on the first "half" of the bow. This can be done by creating a new struct bag_struct with the same "bag" and "bag_size" equal to 1/2 of the original bag_size and calling "bagsearch" recursively. If the "word" is alphabetically after the middle word in the "bow", then the search should be repeated on the second half of the bow. This can be done by creating a new struct bag_struct with "bag" pointing one position past the middle element, and bag size equal to 12 of the orginal bag size. HA :do a few exam es to tizure out act how to ca te oud u or oun down so that you search exactly the right part of the array, and no ur er fa any po nt the muddle element mat he worthen th tune i la det n ndex word in the bag_struct. If"word" is not located in the bag_struct, then the return index should refer to the first word that is alphabetically after "word" int bagsearch( struct bag-struct *bow, char *word ); This function will perform a binary search of the "bag" array contained in the struct bag_struct pointed to by the pointer bow. The binary search should look in the middle of the array for the "word". If the "word" is alphabetically before the middle word in the "bow", then the search should be repeated on the first "half" of the bow. This can be done by creating a new struct bag_struct with the same "bag" and "bag_size" equal to 1/2 of the original bag_size and calling "bagsearch" recursively. If the "word" is alphabetically after the middle word in the "bow", then the search should be repeated on the second half of the bow. This can be done by creating a new struct bag_struct with "bag" pointing one position past the middle element, and bag size equal to 12 of the orginal bag size. HA :do a few exam es to tizure out act how to ca te oud u or oun down so that you search exactly the right part of the array, and no ur er fa any po nt the muddle element mat he worthen th tune i la det n ndex word in the bag_struct. If"word" is not located in the bag_struct, then the return index should refer to the first word that is alphabetically after "word
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
