Re: [algogeeks] Finding total number of inversions in an array in O(nlogn) complexity .

2011-06-09 Thread Anantha Krishnan
ma@IITR > Sent: Thursday, 9 June 2011 4:29 PM > To: algogeeks@googlegroups.com > Subject: Re: [algogeeks] Finding total number of inversions in an array in > O(nlogn) complexity . > > how insertion sort will do in O(nlogn)? > > On Thu, Jun 9, 2011 at 4:27 PM, Navneet Gupta wro

RE: [algogeeks] Finding total number of inversions in an array in O(nlogn) complexity .

2011-06-09 Thread Navneet Gupta
Ohh. Missed out the nlogn condition you mentioned. It will do but in n^2 Sent from my Windows Phone -- From: D.N.Vishwakarma@IITR Sent: Thursday, 9 June 2011 4:29 PM To: algogeeks@googlegroups.com Subject: Re: [algogeeks] Finding total number of inversions in an

Re: [algogeeks] Finding total number of inversions in an array in O(nlogn) complexity .

2011-06-09 Thread D.N.Vishwakarma@IITR
how insertion sort will do in O(nlogn)? On Thu, Jun 9, 2011 at 4:27 PM, Navneet Gupta wrote: > Insertion sort also would do. > > On Thu, Jun 9, 2011 at 4:22 PM, D.N.Vishwakarma@IITR > wrote: > > thanx for suggestion > > > > On Thu, Jun 9, 2011 at 4:08 PM, sunny agrawal > > wrote: > >> > >> Dis

Re: [algogeeks] Finding total number of inversions in an array in O(nlogn) complexity .

2011-06-09 Thread Navneet Gupta
Insertion sort also would do. On Thu, Jun 9, 2011 at 4:22 PM, D.N.Vishwakarma@IITR wrote: > thanx for suggestion > > On Thu, Jun 9, 2011 at 4:08 PM, sunny agrawal > wrote: >> >> Discussed many times, >> 1) add some lines to merge sort >> 2) use Binary indexed tree for a faster version (i have no

Re: [algogeeks] Finding total number of inversions in an array in O(nlogn) complexity .

2011-06-09 Thread D.N.Vishwakarma@IITR
thanx for suggestion On Thu, Jun 9, 2011 at 4:08 PM, sunny agrawal wrote: > Discussed many times, > 1) add some lines to merge sort > 2) use Binary indexed tree for a faster version (i have not tried but get > to know it can be done using binary indexed tree) > > On Thu, Jun 9, 2011 at 4:05 PM, D

Re: [algogeeks] Finding total number of inversions in an array in O(nlogn) complexity .

2011-06-09 Thread sunny agrawal
Discussed many times, 1) add some lines to merge sort 2) use Binary indexed tree for a faster version (i have not tried but get to know it can be done using binary indexed tree) On Thu, Jun 9, 2011 at 4:05 PM, D.N.Vishwakarma@IITR wrote: > Inversion means pair(i,j) such that iA[j] > > -- > **With