2. [3 pts][Pointers + 2D arrays] Given a n*n square matrix. The task is to find the minimum sum of
n elements where each element should be in a unique row and column.
Example:
A = {
{5, 4, 4, 1},
{1, 3, 2, 4},
{3, 2, 3, 2},
{0, 4, 5, 4}
};
(0,0), (1,1), (2,2), (3,3) are 4 elements each of which is in a unique row and column.
The sum is 15.
whereas there are another set of 4 elements
(3,0), (2,1), (1,2), (0,3) each of which is in unique row and column.
The sum is 5.
The minimum among all the sets of similar 4 elements should be selected. Hence, 5 and the set
of elements that sums up to 5 is selected here. [That should be your program’s output.]
Note: For the simplicity, write a program that handles only 4x4 matrices.
Note: Bonus 1 pt if you have minimum sum and maximum sum using the same function at the
same time. I.e. The single function call should give us both the answers.
3. [2 pts][Pointers + Dynamic memory allocation] Implement the stack abstract data type
functionality. Stack is a LIFO data structure: Reading. The functions that you have to implement
are the following:
a. S_new - takes the size of the stack and generates it.
b. S_push - is used to add a new element on top of the stack
c. S_top - is used to read the topmost element
d. S_pop - is used to delete and return the topmost element
Notes: Pointers and Dynamic memory allocation can be used. But no struct or unions of C.
Task: After implementing functions, your program should be capable of creating two stacks and
take input from the user and fill the stacks.
Из условия, что глаз наблюдателя аккомодирован на бесконечность, следует, что в телескопе реализован телескопический ход лучей: пучок параллельных лучей от удаленного точечного объекта выходит из окуляра также параллельным. В этом случае угловое увеличение γ телескопа выражается формулой
y=(-F1/F2)=-20
В условии данной задачи F1 > 0 и F2 > 0. Это означает, что телескоп построен по схеме зрительной трубы Кеплера, которая дает перевернутое изображение. Поэтому угловое увеличение телескопа выражается отрицательным числом. Угол φ, под которым наблюдатель будет видеть изображение Луны, равен
φ = |γ| ∙ ψ = 0,18 рад.