Suppose you have given a circular array of integers where start and size is given. You need to find the second largest even number and second smallest even number of the array. After that, replace the next index value of the second largest even value index with summation of the second largest even value and second smallest odd value, and previous index value of the second smallest even value index with the multiplication of the second largest odd and second smallest even value. Note: You must change the start and size accordingly. Assume that 0 represents empty spaces in the array. [You are not allowed to use any additional array/list or any built-in functions except len(), range()]. Sample Input Sample Output Explanation 44 59 0 000 10 14 4 21 Second Largest Even = 14 Second Smallest Even = 10 | (index 7) and second smallest even is 10 44 59 000 140 10 14 24 21 | (index 6). Here, the second largest even value is 14 start = 6 size = 6 Next index is 8, replaced with (14+10) = 24 and previous index is 5, replaced with |(14*10)=140 (Start and size has been changed) 1 -2 -6 05 67 12 Second Largest Even = 6 Second Smallest Even = -2 | (index 5) and second smallest even is -2 Here, the second largest even value is 6 start = 4 size = 7 (index 1). Next index is 6, replaced with (6+(-2)) =4 and previous index is 0, replaced with (6*(-2)) = -12 -12 -2 -6 0 5 64 12 Activate Windows

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question

Use Python Only.

Suppose you have given a circular array of integers where start and size is given. You need to find
the second largest even number and second smallest even number of the array. After that,
replace the next index value of the second largest even value index with summation of the second
largest even value and second smallest odd value, and previous index value of the second
smallest even value index with the multiplication of the second largest odd and second smallest
even value.
Note: You must change the start and size accordingly. Assume that 0 represents empty spaces in
the array.
[You are not allowed to use any additional array/list or any built-in functions except len(), range()].
Sample Input
Sample Output
Explanation
Second Largest Even = 14 Here, the second largest even value is 14
Second Smallest Even = 10 (index 7) and second smallest even is 10
44 59 000 140 10 14 24 21 | (index 6).
44 59 0 000 10 14 4 21
start = 6
size = 6
%3D
Next index is 8, replaced with (14+10) =
24 and previous index is 5, replaced with
(14*10)=140
(Start and size has been changed)
1 -2 -6 0 5 6 7 12
Second Largest Even = 6
Second Smallest Even = -2 | (index 5) and second smallest even is -2
Here, the second largest even value is 6
start = 4
size = 7
(index 1).
Next index is 6, replaced with (6+(-2)) = 4
and previous index is 0, replaced with
(6*(-2)) = -12
-12 -2 -6 0 5 6 4 12
Activate Windows
to lo SettinIs to adival
Transcribed Image Text:Suppose you have given a circular array of integers where start and size is given. You need to find the second largest even number and second smallest even number of the array. After that, replace the next index value of the second largest even value index with summation of the second largest even value and second smallest odd value, and previous index value of the second smallest even value index with the multiplication of the second largest odd and second smallest even value. Note: You must change the start and size accordingly. Assume that 0 represents empty spaces in the array. [You are not allowed to use any additional array/list or any built-in functions except len(), range()]. Sample Input Sample Output Explanation Second Largest Even = 14 Here, the second largest even value is 14 Second Smallest Even = 10 (index 7) and second smallest even is 10 44 59 000 140 10 14 24 21 | (index 6). 44 59 0 000 10 14 4 21 start = 6 size = 6 %3D Next index is 8, replaced with (14+10) = 24 and previous index is 5, replaced with (14*10)=140 (Start and size has been changed) 1 -2 -6 0 5 6 7 12 Second Largest Even = 6 Second Smallest Even = -2 | (index 5) and second smallest even is -2 Here, the second largest even value is 6 start = 4 size = 7 (index 1). Next index is 6, replaced with (6+(-2)) = 4 and previous index is 0, replaced with (6*(-2)) = -12 -12 -2 -6 0 5 6 4 12 Activate Windows to lo SettinIs to adival
Expert Solution
steps

Step by step

Solved in 3 steps with 3 images

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY