Week 10: Thursday ----------------- Q1. (40) Input three strings s, t and w from the user. Assume that the strings do not contain blank or any whitespace character. Write a function that finds all occurrences of substring t in s, and replaces them by w. The function returns the number of such occurences or replacements. Note that t and w can be of different sizes. For example, if the string s is "abcdefghidefjkl", t is "def" and w is "xy", then after replacement, s becomes "abcxyghixyjkl" and the function returns 2. The parameters of the function replace_substring contains only pointers to characters (not arrays): int replace_substring(char *s, char *t, char *w) Q2. (60) Given a 2-dimensional matrix of 0's and 1's, a 0-region is defined as a maximal set of connected cells containing 0's. A cell is connected to its neighbours at left, right, bottom and top. So, if a cell is (i,j), it is connected to (i-1,j), (i+1,j), (i,j-1) and (i,j+1). Make sure you handle the boundary cases correctly. Input a 2-dimensional matrix of size 5x5 from the user and print the number of 0-regions in the matrix. Also for each region, print the coordinates of any one cell inside it. Assume that the user inputs only 0's and 1's. Also assume that the top-left cell is (0,0). For example, if the input matrix is 1 0 1 1 0 0 0 1 0 1 0 1 0 0 1 1 1 0 0 0 0 0 1 0 1 it has 4 0-regions at cells (0,1), (0,4), (1,3) and (4,0).