Answer:
O(n) which is a linear space complexity
Explanation:
Space complexity is the amount of memory space needed for a program code to be executed and return results. Space complexity depends on the input space and the auxiliary space used by the algorithm.
The list or array is an integer array of 'n' items, with the memory size 4*n, which is the memory size of an integer multiplied by the number of items in the list. The listSize, i, and arithmeticSum are all integers, the memory space is 4(3) = 12. The return statement passes the content of the arithmetic variable to another variable of space 4.
The total space complexity of the algorithm is "4n + 16" which is a linear space complexity.
If it's a holiday, you should be getting a year-end bonus. They hope for you to have a new year when you aren't getting a bonus!
Answer:
int[ ][ ] X = new int[5][5];
It can also be declared and initialized this way:
int[][] X = {
{1,2,3,6,8},
{4, 5, 6, 9},
{7,5,6,8,9},
{8,5,8,8,9},
{10,2,6,8,11},
};
Explanation:
Above is a declaration of a two-dimensional array that can hold 5*5=25 int values. A java program is given below:
public class JavaTwoD{
public static void main(String args[ ]) {
// creating the 5X5 array
int[ ][ ] X = new int[5][5];
// looping through the array to add elements
for (int i = 0; i < X.length; i++) {
for (int j = 0; j < X[i].length; j++) {
X[i][j] = i * j;
}
}
Answer:
19.9 pF
Explanation:
Given that:
Series connection :
11pF and 21pF
C1 = 11pF ; C2 = 21pF
Cseries = (C1*C2)/ C1 + C2
Cseries = (11 * 21) / (11 + 21)
Cseries = 7.21875 pF
C1 = 22pF ; C2 = 30pF
Cseries = (C1*C2)/ C1 + C2
Cseries = (22 * 30) / (22 + 30)
Cseries = 12.6923 pF
Equivalent capacitance is in parallel, thus,
7.21875pF + 12.6923 pF = 19.91105 pF
= 19.9 pF