Answer and Explanation:
After inserting the integers "10", "30" and "20" in an AVL tree, It looks like:
This tree is not balanced. So, to balance this tree, we have to follow some steps:
Step 1 :
After following the LR (Left rotation), Tree will look like:
Step 2 :
Now, following the RL (Right rotation), we will get a balanced AVL tree like:
Answer: D
Explanation:
It is not A or C because the "d" in "Divide" is capitalized and the d is lowercase in calling the function. Therefore the answer is D (the last choice) because numA / numB (30 / 5) equals 6.
In the C programming language, you can't determine the array size from the parameter, so you have to pass it in as an extra parameter. The solution could be:
#include <stdio.h>
void swaparrayends(int arr[], int nrElements)
{
int temp = arr[0];
arr[0] = arr[nrElements - 1];
arr[nrElements - 1] = temp;
}
void main()
{
int i;
int myArray[] = { 1,2,3,4,5 };
int nrElements = sizeof(myArray) / sizeof(myArray[0]);
swaparrayends(myArray, nrElements);
for (i = 0; i < nrElements; i++)
{
printf("%d ", myArray[i]);
}
getchar();
}
In higher languages like C# it becomes much simpler:
static void Main(string[] args)
{
int[] myArray = {1, 2, 3, 4, 5};
swaparrayends(myArray);
foreach (var el in myArray)
{
Console.Write(el + " ");
}
Console.ReadLine();
}
static void swaparrayends(int[] arr)
{
int temp = arr[0];
arr[0] = arr.Last();
arr[arr.Length - 1] = temp;
}
The global positioning system (GPS) is a space-based radio-positioning and time-transfer system. GPS satellites transmit signals to proper equipment on the ground. These signals provide accurate position, velocity, and time (PVT) information to an unlimited number of users on ground, sea, air, and space.
Answer:
Another way to categorise the relation statistics-computer is to list the different ways the computer can be used in statistics. The following are examples of such uses: numerical and graphical data analy- sis; symbolic computations; simulations; storing statistical knowledge; presentation of results.
Explanation: