GDSC-IGDTUW-Autumn-of-Code-2022 / ip-questions-2023

INTERVIEW PRACTICE
0 stars 5 forks source link

Count inversion in an array #15

Open tanisha12j opened 1 year ago

tanisha12j commented 1 year ago

Problem statement-Given an array of integer n ,count the inversion of the array (using merge sort) Input Format: N = 5, array[] = {1,2,3,4,5}

Result: 0

Explanation: we have a sorted array and the sorted array has 0 inversions as for i < j you will never find a pair such that A[j] < A[i]. More clear example: 2 has index 1 and 5 has index 4 now 1 < 5 but 2 < 5 so this is not an inversion.

tanisha12j commented 1 year ago

Hey @Parul-Mann can you assign this issue to me ?

BhavyaDevani commented 1 year ago

@Parul-Mann pls assign this issue to me