71. What is the order of a matrix?
72. Reversal algorithm and juggling algorithm for array rotation have the same time complexity.
73. How many arguments are required by the predefined function rotate() in C++?
74. Who coined the term Sparse Matrix?
75. What is the relation between Sparsity and Density of a matrix?
76. Arbitrary expressions can be used while declaring variable-length arrays.
77. How many inversions does a sorted array have?
78. Which of the following can be called a parallel array implementation?
79. Which of the following is the disadvantage of sparse matrices over normal matrices?
80. What will be the time complexity of the following code?
#include <bits/stdc++.h>
using namespace std;
void func(int arr[], int left, int right)
{
while (left < right)
{
int temp = arr[left];
arr[left] = arr[right];
arr[right] = temp;
left++;
right--;
}
}
void printArray(int arr[], int size)
{
for (int i = 0; i < size; i++)
cout << arr[i] << " ";
}
int main()
{
int arr[] = {1,4,3,5};
int n = sizeof(arr) / sizeof(arr[0]);
func(arr, 0, n-1);
printArray(arr, n);
return 0;
}
#include <bits/stdc++.h>
using namespace std;
void func(int arr[], int left, int right)
{
while (left < right)
{
int temp = arr[left];
arr[left] = arr[right];
arr[right] = temp;
left++;
right--;
}
}
void printArray(int arr[], int size)
{
for (int i = 0; i < size; i++)
cout << arr[i] << " ";
}
int main()
{
int arr[] = {1,4,3,5};
int n = sizeof(arr) / sizeof(arr[0]);
func(arr, 0, n-1);
printArray(arr, n);
return 0;
}Read More Section(Arrays in Data Structures)
Each Section contains maximum 100 MCQs question on Arrays in Data Structures. To get more questions visit other sections.
