We have been working very hard since 2009 to facilitate in learning Read More. We can't keep up without your support. Donate.

www.bit.ly/vucodes

+ Link For Assignments, GDBs & Online Quizzes Solution

www.bit.ly/papersvu

+ Link For Past Papers, Solved MCQs, Short Notes & More

CS301 - Data Structures Assignment # 4 - REQUIRED (Final Last Date 24 Januray)

PLEASE PROVIDE THE SOLUTION !!!
IT's URGENT

 

Assignment No. 04
SEMESTER Fall 2010
CS301- Data Structure
 

 

Total Marks: 15

 

Due Date: 24/01/2011

Instructions

Please read the following instructions carefully before solving & submitting assignment:

It should be clear that your assignment will not get any credit (zero marks) if:

  • The assignment is submitted after due date.
  • The submitted assignment does not open or file corrupt.
  • The assignment is copied (from other student or ditto copy from handouts or internet).
  • Student ID is not mentioned in the assignment File or name of file is other than student ID.

 

Note: Kindly check the template file for submitting assignment. (see announcement)

Uploading instructions

Your Submission must include:

 

  1. A working Make File (Dev-C++ project File).
  2. All the Source Code (.h and .cpp files) necessary to compile and run your program.
  3. Place all the files in a folder then Zip that folder and Upload it on VULMS

 

Note: Use Dev-C++ 4.9.9.2 which is available at VULMS (Download section) or you can use Dev-C++ 4.0 or any other version higher than 4.0.

Objective

The objective of this assignment is

 

  • To give you some practice exercise of Minimum Heap Data Structure.

 

 

 

For any query about the assignment, contact at cs301@vu.edu.pk

GOOD LUCK 

 

Marks: 15 

 

Question:                                                                       

Write a program in c++ that takes any no of elements through command prompt from user and saves it in an array. Then convert it into sorted format with minimum heap sort using your own coded implementation.

 

 

 

 

Note: You can’t use built-in library function or templates for heap functions. All the source code should be written manually.

 

 

Lectures Covered: This assignment covers Lecture # 28-33

Deadline

Your assignment must be uploaded/submitted at or before 24/01/2011.         

 


+ http://bit.ly/vucodes (Link for Assignments, GDBs & Online Quizzes Solution)

+ http://bit.ly/papersvu (Link for Past Papers, Solved MCQs, Short Notes & More)

+ Click Here to Search (Looking For something at vustudents.ning.com?)

+ Click Here To Join (Our facebook study Group)


Views: 228

Replies to This Discussion

A program to implement Heap Sort

#include<iostream.h>
#include<conio.h>

void restoreHup(int*,int);
void restoreHdown(int*,int,int);

void main()
{
int a[20],n,i,j,k;
printf("
Enter the number of elements to sort : ");
scanf("%d",&n);

printf("
Enter the elements : 
");
for(i=1;i<=n;i++){
scanf("%d",&a[i]);
restoreHup(a,i);
}


j=n;
for(i=1;i<=j;i++)
{
int temp;
temp=a[1];
a[1]=a[n];
a[n]=temp;
n--;
restoreHdown(a,1,n);
}

n=j;

printf("
Here is it...
");
for(i=1;i<=n;i++)
printf("%4d",a[i]);
}



void restoreHup(int *a,int i)
{
int v=a[i];

while((i>1)&&(a[i/2]<v))
{
a[i]=a[i/2];
i=i/2;
}
a[i]=v;
}

void restoreHdown(int *a,int i,int n)
{
int v=a[i];
int j=i*2;
while(j<=n)
{
if((j<n)&&(a[j]<a[j+1]))
j++;
if(a[j]<a[j/2]) break;

a[j/2]=a[j];
j=j*2;
}
a[j/2]=v;
}

 

See the attached file for CS301 Assignment#04 Idea Solution
Attachments:
plzz upload right soltion GOD bless u plzzzzz

Dear,

Kindly get me a ZIP file containing all related files for the assignment of CS301 as mentioned in the assignment.

Uploading instructions

Your Submission must include:

 

  1. A working Make File (Dev-C++ project File).
  2. All the Source Code (.h and .cpp files) necessary to compile and run your program.
  3. Place all the files in a folder then Zip that folder and Upload it on VULMS

 

Remember 24th JAN is the LAST DAY!!!

Thanks.

plzz upload rite sort heap file with codes thxxxx
See the attached file for idea solution
Attachments:

DEAR TARIQ BRO,

KINDLY UPLOAD FULL PROJECT FILE INCLUDING ALL RELATED FILES.....

 

 

 

THANK U VERY MUCH IN ADVANCE!!!!

RSS

Looking For Something? Search Below

Latest Activity

© 2021   Created by + M.Tariq Malik.   Powered by

Promote Us  |  Report an Issue  |  Privacy Policy  |  Terms of Service

.