.... How to Find Your Subject Study Group & Join ....   .... Find Your Subject Study Group & Join ....

We are here with you hands in hands to facilitate your learning & don't appreciate the idea of copying or replicating solutions. Read More>>

www.vustudents.ning.com

Study Groups By Subject code Wise (Click Below on your university link & Join Your Subject Group)

[ + VU Study Groups Subject Code Wise ]  [ + COMSATS Virtual Campus Study Groups Subject Code Wise ]

Looking For Something at vustudents.ning.com? Search Here

# CS301 assignment no 3 spring 2018

solution need

last date 26 july 2018

Views: 5588

Attachments:

### Replies to This Discussion

Mojjj kro sary

#include <iostream>
#include <conio.h>
using namespace std;
void min_heapify(int *a,int i,int n)
{
int j, temp;
temp = a[i];
j = 2 * i;
while (j <= n)
{
if (j < n && a[j+1] < a[j])
j = j + 1;
if (temp < a[j])
break;
else if (temp >= a[j])
{
a[j/2] = a[j];
j = 2 * j;
}
}
a[j/2] = temp;
return;
}
void build_minheap(int *a, int n)
{
int i;
for(i = n/2; i >= 1; i--)
{
min_heapify(a,i,n);
}
}
int main()
{
int n, i, x;
cout"enter no of elements of array\n";
cin>>n;
int a[20];
for (i = 1; i <= n; i++)
{
cout"enter element"(i)endl;
cin>>a[i];
}
build_minheap(a, n);
cout"Min Heap\n";
for (i = 1; i <= n; i++)
{
couta[i]endl;
}
getch();
}

A.o.a bhii ya error da raha ha solution??????

Can u help??????

error hai code mein

Ye kia h???

Check it

min heap of all nodes

execute he ni hoti

hoti ha na

ye just example ha.

Ye complete solution h?

ni

sis bas cout py miss hy phr run ho

ri

## Latest Activity

+ Danial -MIT- and Nida arshad are now friends
1 hour ago
3 hours ago
3 hours ago
4 hours ago
4 hours ago
5 hours ago
Sofia Arslan Khan updated their profile
5 hours ago
Samia Aziz posted a status
"CS402"
5 hours ago

## Forum Categorizes

Job's & Careers (Latest Jobs)

Scholarship (Latest Scholarships)

Internship (Latest Internships)

::::::::::: More Categorizes :::::::::::

1

2

3

4

5