Computer Science Fundamentals (CS-111)

 

Home | Course Outline | Quizzes & Exams | Assignments | Books

 

Assignments

Assignment # 1

Solve the following questions.

2.3.1 (b)

2.3.1 (d)

2.3.4

2.5.1

2.5.2

2.5.5

 

Solution Assignment # 1

 

                                            

Assignment # 2

Solve the following questions.

3.4.2 (a to e)

3.6.1

3.6.2

3.6.3

3.6.5

3.6.6

Submission: On 31st December, 2002  4:30 pm

Solution Assignment # 2

 

 

Assignment # 3

 

A. Consider a list of integers L = (a1,a2,.............an) and an integer "x". Design and write a program to do the following.

1. Read the list L from a file and "x" from the console.

(Make a text file by generating the random numbers.)

2. If "x" is not in the list L, insert "x" at the beginning of the list.

3. If there are one or more occurrences of the "x", delete all except the first, and then swap its position with the first element in the list.

4. Write the resultant list to a file.

 

Write recursive function for insert, search, delete and swap to implement the code using both array and linked list data structures.

 

B. Calculate the running times of both implementations. Run both programs on the following cases and complete the following table

 

  Array Linked List
n T(n)Calculated T(n)Actual T(n)Calculated T(n)Actual
10        
500        
1000        

Dead Line: Sunday,  February 02, 2003    5:00 pm

Submission Details: You will have to submit only the soft copy of the Code, Table and the Input and Output files.

A folder will be placed in J:\\Common with title CS-111. You can submit the soft copies until Sunday 5:00 pm. Hard Copies are not required.

 

Important Instructions: 

1. There should not be any cheating or copying cases. If found, will be directed to V&E. So be very careful.

2. Do the assignment carefully as you will be at ease in the coming quiz.

 

LAHORE UNIVERSITY OF MANAGEMENT SCIENCES (LUMS), LAHORE

 

Home | Course Outline | Quizzes & Exams | Assignments | Books