please help The list below must be resolved in C or
C++;
Problem1: program 1: (program1.c, program1.h,
main1.c)
Problem 1:
Lists 1.
Considering the list models (i.e., linear and dynamic), perform
the following implementation requests, considering for this to
structure your solution as follows:
I) An implementation by letter e;
II) A magma implementation that connects all the letters by a
single menu for execution.
a) Write a recursive and a non-recursive
function to count the number of even and odd elements contained in
a dynamic list
b) Create a function that simulates a small
game that uses two lists (i.e., L1 and L2). In this one, each list
has a maximum size of 3 entries and each position must store a
random integer between 1 and 13. In this game, after filling both
lists, also randomly select one more value between 1 and 13 and
show it in the screen. The game rule is as follows: Both lists must
be presented by sequential reading from their parity positions,
i.e. {{L1[0], L2[0]}, {L1[1], L2[1]}, {L1[2], L2[2]}}. Each pair
must be subtracted from the displayed value and the list with the
highest final sum wins the game. Show the winner at the end.
c) Write a function that takes two lists x =
[x1, x2, . . . , xn] and y = [y1, y2, . . . , yn] and return a list
z = [(x1, yn),(x2, yn−1, . . . ,(xn, y1)] In the end, the lists x
and y must be empty. d) Write a function that
takes pairs of lists x = [x1, x2, . . . , xn] and y = [y1, y2, . .
. , ym] with n, m > 0 and n = m. Calculate the Euclidean
distance between the multiple received pairs and find the k closest
pairs.
please help The list below must be resolved in C or C++; Problem1: program 1: (program1.c, program1.h, main1.c) Problem
-
- Site Admin
- Posts: 899603
- Joined: Mon Aug 02, 2021 8:13 am