https://www.google.com/contributor/welcome/?utm_source=publisher&utm_medium=banner&utm_campaign=2376261057261409

Search This Blog

Search with our Site

Custom Search
Showing posts with label cs301. Show all posts
Showing posts with label cs301. Show all posts

Sunday, November 24, 2013

Assignment No. 02 SEMESTER Fall 2013 CS301- Data Structures Total Marks: 20 Due Date: 28/12/2013


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 code does NOT compile. 
 The submitted assignment file is other than .CPP format. 
 The submitted assignment file does not open or corrupted. 
 The assignment is copied (from other student or ditto copy from handouts or internet). 

Uploading instructions 
For clarity and simplicity, You are required to Upload/Submit only one .CPP file. 
 Don’t wait for grace day. Grace Day is given only if there is problem with LMS on due date. Submit 
your solution within due date. 
 Note that no assignment will be accepted through email if there is any problem on grace day. 

Note: Use only dev-C++ IDE. 

Objective 
The objective of this assignment is
o To make you familiar with queue and linked list data structures and programming techniques to 
implement queue as linked list. 

For any query about the assignment, contact at cs301@vu.edu.pk 
GOOD LUCK 
Marks: 20 
Suppose there is a large busy cosmetic store. In store, for billing, there are four counters with four tellers (who 
deal payment etc). A customer comes to the store and collects the things he/she wants to purchase and go to one 
of the counters to pay for purchase. If there are already people in front of counters, customer has to stand in the 
queue. A customer generally selects the shortest queue (with respect to the number of people in queue). The 
selection can become wrong if one of the people in the queue has a huge buying list. But if we know the 
estimated time of each customer in the queue, selection can become efficient. The system can become efficient, if 
we tell a new person which one is the shortest queue with respect to time taken by the people waiting in the 
queue. 

Considering the above scenario, write a C++ program which asks a user to enter the estimated time to process 
the bill. The program will tell the user, in which queue he/she can stand with respect to the total time of all the
persons already in the queues. At the end of the day the system will display the total number of customers deal 
by every Teller and which Teller has deal maximum number of customers.   
Solution Guidelines: 
1) To pay the bills, Customer must have to stand in the queue. The length of the queue can vary so you have 
to implement queue as linked list. 
2) Create a class named Customer (Node class); this class should create a node (customer) in the queue. 
This class should define two private data members, time and Next pointer. A constructor, getter and setter 
functions for each data member should also be defined in this class. 
3) Create another class named Teller (List class); to create a queue for each teller, this class should define 
three variables, Front pointer, Rear pointer and counter. The class should also define the following 
functions: 

Constructor(): Default constructor of the class. 
Destructor(): Destructor to destroy the memory gained by the use of new operator. 
AddCustomer(): This method should enter the new customer at the rear. 
TotalCustomer(): This method should return the total number of customers in a queue. 
TotalTime(): This method should return the total time of customers standing in said queue. 

4) In main() method of the program, create four objects of the class Teller which will act like four 
counters at store. These objects should be able to perform all the required functionalities mentioned in the 
question statement. 
5) You can add more variables and functions to obtain the given functionalities according to your need.

Wednesday, November 20, 2013

CS301 Assignment 2 (Graded) Announcement fall 2013






Assignment 2 (Graded) Announcement

Dated: Nov 20, 13

Dear Students,



Be prepared for the assignment 2 which will cover lectures 1-10. This assignment will be graded and marks of this assignment will be considered in your final marks.

Opening Date: 21/11/2013 (21 November 2013)
Closing Date: 28/11/2013 (28 November 2013)

Wish you best of luck!





Regards,

Instructor CS301




Friday, January 20, 2012

Assignment # 5 CS301 Fall 2011 idea solution






Assignment # 5 CS301 Fall 2011 Due Date 23 jan 2011


Assignment No. 05
SEMESTER fall 2011
CS301- Data Structures

Total Marks: 20

Due Date: 23rd January
                    2012          
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:
o        The assignment is submitted after due date.
o        The submitted assignment does NOT open or file corrupt.
o        The assignment is copied (from other student or ditto copy from handouts or internet).
Objective
The objective of this assignment is to give you some practice exercise of

o   Max heap and Min Heap
o   Union


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

Marks: 20 

Question No.1                                                                                                   (5+5 Marks)

Consider the following array as input

13
4
6
8
9
7
10
15




I)                   Prove that it is a heap and also explain what type of heap it is.?
II)                Add 16 and 3 into the heap and convert it into Max heap.



Question No: 2                                                                                               Marks: 10

                                                                                                                                 
Perform the following sequence of Union operations on the set of elements {1,2,3,4,5,6,7,8,9,10,11} using Union by Size.

Union(1,2)
Union(3,5)
Union(3,6)
Union(1,4)
Union(3,9)
Union(10,11)
Union(1,10)
Union(7,8)
Union(10,7)
Union(1,3) .

Lectures Covered:  This assignment will covers 29 to 36 Lectures
Deadline:                  Your assignment must be uploaded/submitted at or before  23rd  January 2012.

Saturday, January 7, 2012

CS301 Assignment No 4 Solution & Discussion Due Date: 11-01-2012



Assignment No. 04
SEMESTER fall 2011
CS301- Data Structures

Total Marks: 20

Due Date: 11th January
                    2012          
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:
o                   The assignment is submitted after due date.
o                   The submitted assignment does NOT open or file corrupt.
o                   The assignment is copied (from other student or ditto copy from handouts or internet).
Objective
The objective of this assignment is to give you some practice exercise of

o       Huffman Encoding
o       Comparison of Huffman code with ASCII code.

What to Submit
Submit the word file. Kindly note that C++ code is NOT required for this assignment.

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

Marks: 20 





Question No: 1                                                                                               Marks: 20

Consider the following sequence:

computer revolutionized the world$

a)      Draw frequency table                                                                                                                 3 marks
b)      Create a Huffman tree                                                                                                                8 marks
c)      Determine the binary code for each character                                                                            5 marks
d)   Compare the Huffman encoded sequence with the encoding of sequence with ASCII code      4 marks

Lectures Covered:  This assignment covers Lecture # 24-26
Deadline:                  Your assignment must be uploaded/submitted at or before 11th January 2012.