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


+ Link For Assignments, GDBs & Online Quizzes Solution


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

Data Structures (CS301)

Assignment # 4(Graded)

  Total marks = 20

                                                                                  Deadline Date = 02/02/2016


Please carefully read the following instructions before attempting assignment.

Rules for Marking

It should be clear that your assignment would not get any credit if:


  • The assignment is submitted after the due date.
  • The submitted assignment does not open or file is corrupt.
  • Strict action will be taken if submitted solution is copied from any other student or from the internet.


1)      You should concern recommended books to clarify your concepts as handouts are not sufficient.

2)      You are supposed to submit your assignment in .cpp format. Any other formats like scan images,doc, PDF, zip, rar, bmp etc will not be accepted.



No assignment will be accepted after the due date via email in any case (whether it is the case of load shedding or internet malfunctioning etc.). Hence refrain from uploading assignment in the last hour of deadline. It is recommended to upload solution file at least two days before its closing date.


For any query, feel free to email at:


Assignment Question:


Suppose we want to develop software for token machine of ABC bank. At entrance, token machine generates token for each customer. The first 10 customers received the following token numbers:


00, 11, 22, 33, 44, 55, 66, 77, 88 and 99



Students are required to write C++ code in order to:


  1. Build a Min heap from the above data
  2. Build a Max heap from the above data


Solution Guidelines:

Your solution should contain the following functions:





buildMaxHeap() function is used to build MaxHeap.

buildMinHeap() function is used to build MinHeap.

maxHeapify() function is used to arrange the values according to the max heap property.

minHeapify() function is used to arrange the values according to the min heap property.


In main() function, declare an array of 10 elements of integer type. Assign the values as given in the sample output.

Then call the buildMaxHeap() function and print the max heap values as given in the sample output.

Then call the buildMinHeap() function and print the min heap values as given in the sample output.



Sample output:


Best of luck!

+ 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: 7503


Replies to This Discussion

Output of the Assignment 

Ap log lucky ho is level ki coding assignments milta hy. those who able to get these level of concepts industry is waiting 4 them. Best of luck.

Ash kero sub right solution is here........



dear umer zunair this is not fulfill the assignment output.

its has some error coz when u press any key after execution of prog its ouput disappears

A.o.A as code me earr hai please bhi g send the complete correct code ak din rha ga hai plz help ker do

i respect u,r participation but i cant see any object orientation or class , Heep is implement through class in handouts, i think u have to implement via class & dynamic array. refer to lecture #31 for idea.


i have jsut make this for idea.... please you have to change its output according to the sample output.

rather everything is ok in my solution file......


Looking For Something? Search Here


This is a member-supported website. Your contribution is greatly appreciated!

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

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