Practice Real Company Assessment Patterns • Latest 2025–2026 Mock Tests

Programming Exercises

Implement a program to sort an array of integers using the quicksort algorithm.

Hard

Problem Statement

Implement a program to sort an array of integers using the quicksort algorithm.

Sample Input

int arr[] = {5, 3, 8, 6, 2};

Sample Output

Sorted array: 2 3 5 6 8 

Limits

Time: 2s · Memory: 256 MB

Code Editor
00:00
#include <iostream> void quicksort(int arr[], int low, int high); int main() { // Logic to demonstrate quicksort return 0; }
Log in or sign up to run or submit your code.Log inSign up
Input
int arr[] = {5, 3, 8, 6, 2};
Expected Output
Sorted array: 2 3 5 6 8