+1 vote
in Data Structures & Algorithms I by (110k points)
Predefined function rotate() in C++ is available under which header file?

(a) math

(b) stdio

(c) stdlib

(d) algorithm

My question is from Arrays Types topic in portion Arrays Types of Data Structures & Algorithms I

I had been asked this question in semester exam.

1 Answer

+1 vote
by (408k points)
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.

Related questions

Welcome to TalkJarvis QnA, a question-answer community website for the people by the people. On TalkJarvis QnA you can ask your doubts, curiosity, questions and whatever going in your mind either related to studies or others. Experts and people from different fields will answer.

Categories

...