Answer:
def recurSquare(n):
if n == 0:
return 0
return recurSquare(n-1) + n + n-1
print(recurSquare(2))
Explanation:
Programming language used is Python.
The recursive function is defined as recurSquare(n)
The IF statement checks the argument that is passed to the function to ensure it is not equal to zero.
The function is a recursive function, which means it calls itself.
In the return statement the function calls itself and the argument is reduced by 1.
The function keeps calling itself until n is equal to zero (n == 0) it returns zero and the function stops.
Answer:
Members of the Sales group will be able to edit content and delete files.
Explanation:
NTFS (New Technology File System) is the standard file system for Microsoft Windows NT and later operating systems; NTFS permissions are used to manage access to data stored in NTFS file systems.
Share permissions manage access to folders shared over a network; they don’t apply to users who log on locally.
The share permission is applicable in this question.
On the security tab, where the sales group have read & execute, modify and write permission will allow the sales group users to
1. Modify: allows you to read, write, modify, and execute files in the folder, and change attributes of the folder or files within
2. Read and Execute: will allow you to display the folder's contents and display the data, attributes, owner, and permissions for files within the folder, and run files within the folder
Answer:
B. IF function should be used to display a value based on a comparison.
I'm not sure of the problem that you had in the first place, but I can point out that in your "bigger" method, if a number is greater than one then it is bigger, however the else statement says that the number *can* also be equal[==] to the second argument, so for example bigger(1,1) it would check if 1 > 1 and return false, so it will return that b[the second 1] is bigger! Hope this helps :D
Answer:
You can simplify the problem down by recognizing that you just need to keep track of the integers you've seen in array that your given. You also need to account for edge cases for when the array is empty or the value you get would be greater than your max allowed value. Finally, you need to ensure O(n) complexity, you can't keep looping for every value you come across. This is where the boolean array comes in handy. See below -
public static int solution(int[] A)
{
int min = 1;
int max = 100000;
boolean[] vals = new boolean[max+1];
if(A.length == 0)
return min;
//mark the vals array with the integers we have seen in the A[]
for(int i = 0; i < A.length; i++)
{
if(A[i] < max + 1)
vals[A[i]] = true;
}
//start at our min val and loop until we come across a value we have not seen in A[]
for (int i = 1; i < max; i++)
{
if(vals[i] && min == i)
min++;
else if(!vals[i])
break;
}
if(min > max)
return max;
return min;
}