Ques 1. Given an array of distinct elements. Find the third largest element in it. Return -1 if not present (hints)

Input

arr[] = {2, 4, 1, 3, 5}

Output

3

Ques 2. Reverse the given array (hints)

Input

arr[] = {2, 4, 1, 3, 5}

Output

arr[] = {5, 3, 1, 4, 2}

Ques 3. Rotate the given in anti-clockwise direction array by k positions (hints)

Input

arr[] = {2, 4, 1, 3, 5}, k = 2

Output

arr[] = {1, 3, 5, 2, 4}

We use cookies to ensure that we give you the best experience on our website. If you continue to use this site we will assume that you are happy with it.OkPrivacy policy