What Will Be The Auxiliary Space Requirement Of The Following #405
What will be the auxiliary space requirement of the following code?</p> <pre><code class="language-c"> #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; } </code></pre>
This multiple choice question (MCQ) is related to the book/course gs gs121 Data Structures and Algorithms. It can also be found in gs gs121 Array Types - Reversal Array Operation - Quiz No.1.
Similar question(s) are as followings:
Online Quizzes of gs121 Data Structures and Algorithms
Binary Trees - Binary Search Tree - Quiz No.1
gs gs121 Data Structures and Algorithms
Online Quizzes
Binary Trees - Binary Search Tree - Quiz No.2
gs gs121 Data Structures and Algorithms
Online Quizzes
Binary Trees - Preorder Traversal - Quiz No.1
gs gs121 Data Structures and Algorithms
Online Quizzes