1.

Predefined function rotate() in C++ is available under which header file?(a) math(b) stdio(c) stdlib(d) algorithmMy question is from Arrays Types topic in portion Arrays Types of Data Structures & Algorithms II had been asked this question in semester exam.

Answer»

The CORRECT ANSWER is (d) algorithm

Easy explanation - The predefined function for rotating an array is rotate() in C++ which comes under the LIBRARY called algorithm. It requires 3 ARGUMENTS the first being the pointer to the starting index of the array and the last being the pointer to the last index of the array. The MIDDLE argument is the pointer to the element that becomes the first element in the rotated array.



Discussion

No Comment Found

Related InterviewSolutions