negate all the even indices
sort the array
no extra space.
just an idea!!
--
You received this message because you are subscribed to the Google Groups
Algorithm Geeks group.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from this group, send email to
here DP is more effective
--
You received this message because you are subscribed to the Google Groups
Algorithm Geeks group.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from this group, send email to
algogeeks+unsubscr...@googlegroups.com.
For more options,
@subramania jeeva ..can we have example with explanation as
algorithmic approach is fine..!!!
Thanks
Shashank
--
You received this message because you are subscribed to the Google Groups
Algorithm Geeks group.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe
#includestdio.h
#includealgorithm
using namespace std;
int heap_size1,heap_size2;
int main()
{
int n,a[100],j,k;
scanf(%d,n);
for(int i=1;i=n;i++)
scanf(%d,a[i]);
if(n%2)
{
heap_size2=n/2+1;
k=n-1;
}