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

(a) math

(b) stdio

(c) stdlib

(d) algorithm

This intriguing question comes from Arrays Types topic in chapter Arrays Types of Data Structures & Algorithms I

The question was posed to me by my school principal while I was bunking the class.

1 Answer

+1 vote
by (408k points)
selected by
Best answer
Right answer is (d) algorithm

Explanation: The predefined function for reversing an array is reverse() in C++ which comes under the library called an algorithm. It requires 2 arguments the first being the pointer to the starting index of the array and the second being the pointer to the last index of the 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.