Question: (4). // a[ ] is an array of size n X = a[0]; y = 1; Z = 1; for i = m 1
![(4). // a[ ] is an array of size n X =](https://s3.amazonaws.com/si.experts.images/answers/2024/05/6647d4ccbe670_5646647d4cca6231.jpg)
![a[0]; y = 1; Z = 1; for i = m 1](https://s3.amazonaws.com/si.experts.images/answers/2024/05/6647d4cd17a11_5656647d4cd04669.jpg)
(4). // a[ ] is an array of size n X = a[0]; y = 1; Z = 1; for i = m 1 to n-1 if (a[i] != (a[i-1])){ } else { z = 1; Z = z + 1; if (z > y) { y = Z; x = a[i]; } } return x; } (5). // a[ ] is an array of size n int x =a[0]; int y = 1; for i = 1 to n-1 { if (a[i] == a[i-y]) { x = a[i]; y = y + 1; } } return x; Express the running time of each code segment as a function of n using the big-Oh notation. You need to justify your answers. If you show only answers without justification, no points will be given even though your answers are correct.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
