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

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

Assignment No. 01 (Graded)
SEMESTER Fall 2018
CS301- Data Structures

Total Marks: 20

Due Date:  10 /12 /18


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:

o        The assignment is submitted after due date.

o        The submitted assignment is other than .cpp file.

o        The submitted assignment does NOT open or file is corrupted.

o        The assignment is copied (from other student or ditto copy from handouts or internet).

Uploading instructions

o   For clarity and simplicity, you are required to Upload/Submit only .cpp file.


The objective of this assignment is:

o   To make you understand the different traversal forms of a Binary Search Tree data structure.


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



Marks: 20 


Binary Search tree is the most efficient data structure for solving different problems. Construction of BST (Binary Search Tree) depends on the order in which data is inserted into the tree. For building a Binary Search Tree, data should be inserted into a tree in a way that nodes with smaller data values appears on left side and larger node values appears on right side of the root node.

Write a menu based system program in C++ that will allow you to:

Enter Employee data in BST


Post order traversal of all the Employee data


Show data in ascending order



Take the following attributes of an Employee from the user:

empId, empNname, empSalary

You have to implement the above scenario using BST on the basis of Employee Id. i.e. if the Id of the Employee is lesser than the root node then enter the next Employee data in the left child otherwise in right child.


  • BST will implement using Linked List.
  • Program will not allow entering duplicate employee id.
  • Design the program in a way that the user will be able to enter maximum 10 records.
  • Take empId, empName, empSalary from the user. At least 4 students record should be already entered (hard coded records).

You will use following already entered Employees data (hard coded records).

Emp Id
























Solution Guidelines:

  • You will use buildBST() method to build Binary Search Tree from the above given data.
  • Use the ascendingOredr() method to show the output in ascending order. With respect to empId.
  • Use postOrder() method to traverse the records in post-order.



Sample output 1:

Sample output 2:




Share This With Friends......

+ Click Here To Join also Our facebook study Group.

This Content Originally Published by a member of VU Students.

+ Prohibited Content On Site + Report a violation + Report an Issue

..How to Join Subject Study Groups & Get Helping Material?..

Views: 317

See Your Saved Posts Timeline


Reply to This

Replies to This Discussion

Mjy b soln chaiye

solution hea lakan ak error he us mn

If anyone need best solution, then watch the below video

click here to watch CS301 best solution

Click here to watch CS301 best solution

click here for CS301 correct solution


Latest Activity

Profile IconJawwad Haider, Zuwa Malik, Ghazanfar Ali and 4 more joined Virtual University of Pakistan
18 minutes ago
Anu maik mcs2 updated their profile
1 hour ago
Imii khan posted a status
"Work hard in silence let your success be your noise"
2 hours ago
sara updated their profile
2 hours ago
Imii khan posted a status
"Best lesson I have learned in life came from the worst feeling I ever felt in life"
2 hours ago
+ " Go to HEll updated their profile
3 hours ago
+ " Go to HEll replied to + " Go to HEll's discussion Lets celebrate the birthday of our sariyal boongy member Timbaktu.....
3 hours ago
+ 彡JK彡 B.ED 1.5 ❤️ replied to + Տҽհɑɾ Ƙհɑղ +'s discussion !...منافقوں کی بستی میں اپنا بسیرا ہے
3 hours ago

Study Corner For DigiSkills Students

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

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