You are on page 1of 17

Guidelines for B. Sc. (H) Computer Science Semester III CSHT 305: Design and Analysis of Algorithms S No.

1 2 3

Topic
Graphs & Trees Growth Functions Recurrence

Chapter/Sections
Appendix B: B4 and B5 (self study) Chapter 3 (self study) Chapter 4 (Excluding 4.1, 4.2 and 4.4) (self study) Chapter3, Section 3.5 (Including correctness of Sequential and Binary Search) Chapter 4 (Excluding 4.8, 4.10 and 4.11) Chapter 6 Chapter 8 Chapter 9 Chapter 13 Chapter 14 Chapter 15 (Excluding 15.5) Chapter 16 (Excluding 16.4 and 16.5) Chapter 17 (Excluding 17.4) Chapter 21 (Excluding 21.3 and 21.4) Chapter 22 (Excluding proofs for the theorems ) Chapter 23 (Excluding proofs for the theorems ) Chapter 11 (Excluding 11.4 and 11.5)

Reference
[1] [1]

Weightage*

[1] 20 [2]

Searching

Basic Sorting Algorithms Heap Sort Sorting in Linear Time Medians & Order Statistics Red-Black Trees Augmenting Data Structures Dynamic Programming Greedy Algorithms Amortized analysis Disjoint Sets Elementary Graph Algorithms Minimum Spanning Trees String Matching

[2]

6 7 8 9 10 11 12 13 14 15

[1] [1] [1] [1] [1] [1] [1] [1] [1] 18

10

[1]

22

16

[1] [2] 5

17

Reference Books: [1] Thomas H. Cormen, Charles E. Leiserson, Ronald L. Rivest and Clifford Stein Introduction to Algorithms, PHI, Third Edition. [2] Computer Algorithm: Introduction to Design and Analysis, Sara Baase & A.V.Gelder Publisher Pearson, 1999

* The question paper should include at least 25% application-based questions writing an algorithm using the techniques studied, analysis of new algorithms that may not be a part of guidelines, writing recurrence relations for new algorithms that may not be a part of guidelines

Prepared on 20-07-2012

CSHT 306: System Programming (Max Marks : 75)


S.No. Topic 1. Chapter Reference Distribution Marks [1] 5 of

Introduction to System 1.1software 1.3.3 and machine architecture

2.

Language Processors

[2]

10

3.

Assemblers

2.1-2.4

[1]

15

4.

Loaders and Linkers

3.1-3.4

[1]

15

5.

Macro Processors

4.1-4.3

[1]

10

6.

Compilers and Interpreters 5.15.4.3

[1]

20

References: [1]. Leland L. Beck, D Manjula, System Software: An Introduction to Systems Programming, Pearson, 3rd Edition. [2]. D.M. Dhamdhere, Systems Programming and Operating Systems, Tata McGraw-Hill Publishing Company, Ltd; Second Revised edition. Recommended Readings: 1. John J Donovan , System Programming, Tata McGraw-Hill Edition 1991

CSHT 307 Database Systems


Topic Chapter No. of Marks (Approximate) 6 8 8

Databases and Database Users Database System Concepts and Architecture Data Modeling Using Entity-Relationship (ER) Model The Enhanced Entity-Relationship (EER) Model The Relational Data Model and Relational Database Constraints Relational Algebra Relational Database Design by ER- and EER-to- Relational Mapping SQL-99: Schema Definition, Constraints, Queries, and Views Introduction to SQL Programming Techniques Functional Dependencies and Normalization for Relational Databases Introduction to Transaction Processing Concepts and Theory XML: Extensible Markup Language

Chap 1 Chap 2 Chap 3 (Except 3.8)

Chap 4 (Upto 4.5)

Chap 5 Chap 6 (Upto 6.5) Chap 7

6 5

Chap 8 To be covered in Practical only Chap 10

10

10

Chap 17 (Upto 17.3) Chap 27 (Upto 27.2) TOTAL

5 75

Reference: [1] R. Elmasri, S.B. Navathe, Fundamentals of Database Systems (5th Ed.), Pearson Education

Basic Statistics & Probability


w.e.f. July2012

STC-301
UNIT 1: Basic Statistics (Reference[ 3]) Ch 2 Ch 3 Ch 4 Complete Complete Complete (Reference [1, 2]) Ch 2A Complete

UNIT 2: Probability Reference :[1] Ch 1 Complete

(Reference-[1])

Ch 2 (2.1 to 2.6 [up to example 2.46, pg 70] & excluding example 2.37, pg 60), In 2.5.4 emphasis will be on concepts and simple examples only. (Reference [1]) Reference :[2] Ch 5 (5.5) (Reference [2]) Ch 6 (6.3 up to pg 204, example 6.1) (6.4 upto theorem 6.5,pg207) (Reference [2])

Minimal set of Exercises to be done : Reference [1] Ch 1 Ch 2 # 5, 13, 18, 21, 24, 26, 30, 32, 36, 39, 40-48. # 1, 9, 15, 20, 31, 32-40, 46, 50, 54, 76, 77.

REFERENCES: [1] Ross, S.M. (2008): Introduction to Probability Models, 9 th Edn., Indian Reprint, Academic Press. [2] Freund J.E. (2009): Mathematical Statistics with Applications, 7 th Edn. (Indian Reprint), Pearson Education. [3] Gupta, S.P, Agarwal Archana (2010): Statistical Methods, 8 th Revised Edn (2009), Reprint 2010, Sultan Chand & Sons

Pattern of Question Paper:


Total number of questions will be 17 and out of which 15 need to be answered. Each question will carry 5 marks. There will be three sections in the question paper. Section I: 7 questions covering entire syllabus; 2questions from Basic statistics (Unit 1) and 5 from Probability (Unit 2). [7x5=35 marks] Section II: 3 questions from Basic Statistics (Unit 1) in which students has to answer 2 [2x5=10 marks] Section III: 7 question from Probability (Unit 2) in which students has to answer 6. [6x5=30 marks]

Distribution of Marks: UNIT 1: Basic Statistics: 20 marks UNIT 2: Probability : 55 marks

CSHP 304 : Software Lab. based on CSHT 305 1. Implement Insertion Sort(The program should report the number of comparisons) 2. Implement Merge Sort(The program should report the number of comparisons.) 3. Implement Heap Sort.(The program should report the number of comparisons.) 4. Implement Quick sort.(The program should report the number of comparisons.) 5. Implement Randomized Quick sort.(The program should report the number of comparisons.) 6. Implement Radix Sort. 7. Implement Count Sort. 8. Implement Bucket Sort. 9. Implement Randomized-Select to select ith smallest element from an array of numbers.(The program should report the number of comparisons.) 10. Create a Red-Black Tree and perform following operations on it: i) Insert a node ii) Delete a node iii) Search for a number & also report the color of the node containing this number. 11. WAP to determine the LCS of two given sequences. 12. Implement Breadth-First Search in a graph. 13. Implement Depth-First Search in a graph. 14. WAP to determine the minimum spanning tree of a graph. 15. Implement Huffman Coding. 16. Find second largest in a list using tournament method. For the algorithms at S.No 1 to 5 test run the algorithm on 20 different inputs of sizes varying from 30 to 1000. Count the number of comparisons and draw the graph. Compare it with a graph of nlogn. For the algorithms at S.No 6,7,8 test run the algorithm on 20 different inputs of sizes varying from 30 to 1000. Count the number of operations and draw the graph. For plotting the above mentioned graphs, on x axis plot different values of n(input size) and on y axis plot corresponding number of comparisons. Prepared on 20-07-2012

CSHP 305 : Software Lab based on CSHT 306


Commands/ Statements to be covered: if, for, while, case, Command line arguments, shift, set, expr, who, wc, tr, sort, cut, grep, AWK, find , cat, more, tail , head, echo, ps, kill, pwd, cal, ls, date, chmod, pr. LEX, YACC ( using any replacement of these on Unix, Linux, Fedora, Red Hat, UWin etc)

List of Programs
Section A: Shell Programming
1. Write a shell script which accepts any number of arguments from command line and prints them in the reverse order(for example, if script is named rags, then executing rags A B C should produce C B A on the standard output). (use for loop).

2. A Unix program to eliminate multiple spaces and tabs and replace with a single space and remove empty lines.
3. Write a Shell program to enhance the inbuilt cal program as below: Recognize the month by name. e.g. jan, Jan, JAN, January etc. Given zero arguments, should print the current months calendar. Given one argument, prints the month or years calendar. Given two arguments, should behave like cal, except for converting month names into numbers. 4. Write a menu driven shell script to generate the following choices for user: i) To display the file. ii) To display the permissions of the file. iii) To find the pattern in the file a. ignoring the case and b. case sensitive. (using grep) iv) To replace all letters e by a. 5. Write a menu-driven shell script to generate the following choices for user: a) To display the last n (entered by user) lines from the file. b) To sort the file in either ascending order or descending order. (using sort command) 6. Write a shell script to print the Good morning, Good Afternoon, Good Evening or Good Night according to the time of the day. 00:00 A.M 11:59 A.M: Good Morning 12:00 P.M -3:59 P.M: Good Afternoon 4:00 P.M-7:59 P.M: Good Evening 8:00 P.M-11:59: Good Night 7. Write a shell script to list the users currently using the system along with a count of the numbers of times they have logged in.

8. Write a Shell program to accept filename or Directory name from the user and only if the particular file exists and not a directory, allow the user to either i) overwrite the contents of that file or ii) append the contents in the previous contents of that file. 9. Write the shell script to compare two given files, if the contents are same remove the second one. 10. Write the shell script to merge the contents of three given files, sort the text contained in them and display the sorted output on the screen page by page. 11. Write a Shell program to modify the inbuilt cal program to be able to handle following input: $ cal jan mar nov 12. Write a Shell program to modify the inbuilt cal program to be able to handle following input: $ cal jan.oct

Based on AWK
13. Write an awk script to delete duplicated line from a text file. The order of the original lines must remain unchanged.

14. Write an AWK Program to implement any sorting technique (Bubble/ Selction/Insertion)
15. Write a shell script to check the existence of file in the current directory and folds lines of text of a file beyond 30 characters. (using awk). 16. Write an awk script that accepts date argument in the form of mm-dd-yy and displays it in the form if day, month, and year. The script should check the validity of the argument and in case of error, display a suitable message. 17. Write a awk script that accepts two file names as arguments, checks if their permissions are identical (or) Different.

Section B: Lex and Yacc Program 1. Write a Lex program to count the number of lines and characters in the input file. 2. Write a Lex program that implements the Caesar cipher: it replaces every letter with the one three letters after in in alphabetical order, wrapping around at Z. e.g. a is replaced by d, b by e, and so on z by c. 3. Write a Lex program that finds the longest word (defined as a contiguous string of upper and lower case letters) in the input.

4. Write a Lex program that distinguishes keywords, integers, floats, identifiers, operators, and comments in any simple programming language. 5. Write a LEX program to count the number of identifiers in a C file. 6. Write a LEX program to count the number of words, characters, blank spaces and lines in a C file. 7. Write a LEX specification program that generates a C program which takes a string abcd and prints the following output. abcd abc ab a 8. A program in LEX to recognize a valid arithmetic expression. 9. Write a YACC program to find the validity of a given expression (for operators + - * and /)A program in YACC which recognizes a valid variable which starts with letter followed by a digit. The letter should be in lowercase only. 10. A Program in YACC to evaluate an expression (simple calculator program for addition and subtraction, multiplication, division). 11. Program in YACC to recognize the string abbb, ab a of the langauge (anbn , n>=1). 12. Program in YACC to recognize the language (anb , n>=10). (output to say input is valid or not)

CSHP 306 : Software Lab. based on 307


Create and use the following database scheme to answer the given queries. EMPLOYEE SCHEME Field Eno Ename Job_type Manager Hire_date Dno Commission salary Type Char(3) varchar(50) varchar(50) Char(3) date int Decimal(10,2) Decimal(7,2) NULL NO NO NO Yes NO YES YES NO KEY PRI DEFAULT NIL NIL NIL NIL NIL NIL NIL NIL

FK FK

EMPLOYEE State
_________________________________________________________________ | eno | ename | job_type | manager | hire_date | dno | commission | salary | | 765 | Martin | Sales_man | 198 | 1981-04-22 | 30 | 1400.00 | 1250.00 | | 756 | Jones | Manager | 783 | 1981-04-02 | 20 | 0.00 | 2300.00 | | 752 | Ward | Sales_man | 769 | 1981-02-22 | 30 | 500.00 | 1300.00 | | 749 | Allan | Sales_man | 769 | 1981-02-20 | 30 | 300.00 | 2000.00 | | 736 | Smith | Clerk | 790 | 1980-12-17 | 20 | 0.00 | 1000.00 | | 793 | Miller | Clerk | 788 | 1982-01-23 | 40 | 0.00 | 1300.00 | | 792 | Ford | Analyst | 756 | 1981-12-03 | 20 | 0.00 | 2600.00 | | 790 | James | Clerk | 769 | 1981-12-03 | 30 | 0.00 | 950.00 | | 787 | Adams | Clerk | 778 | 1983-01-12 | 20 | 0.00 | 1150.00 | | 784 | Turner | Sales_man | 769 | 1981-09-08 | 30 | 0.00 | 1450.00 | | 783 | King | President |NULL | 1981-11-17 | 10 | 0.00 | 2950.00 | | 788 | Scott | Analyst | 756 | 1982-12-09 | 20 | 0.00 | 2850.00 | | 778 | Clark | Manager | 783 | 1981-06-09 | 10 | 0.00 | 2900.00 | | 769 | Blake | Manager | 783 | 1981-05-01 | 30 | 0.00 | 2870.00 | DEPARTMENT SCHEME Field Dno Dname location Type int Varchar(50) Varchar(50) NULL No Yes Yes KEY PRI DEFAUL T NULL NULL New Delhi

DEPARTMENT STATE ___________________________ | dno | dname | location | | 10 | Accounting| New York | | 20 | Research | Dallas | | 30 | Sales | Chicago | | 40 | Operation | Boston | | 50 | Marketing | New Delhi |

Queries:

1) Query to display Employee Name, Job, Hire Date, Employee Number; for each employee with the Employee Number appearing first. 2) Query to display Unique Jobs from the Employee Table. 3) Query to display the Employee Name concatenated by a Job separated by a comma. 4) Query to display all the data from the Employee Table. Separate each Column by a comma and name the said column as THE_OUTPUT. 5) Query to display the Employee Name & Salary of all the employees earning more than $2850. 6) Query to display Employee Name & Department Number for the Employee No= 7900. 7) Query to display Employee Name & Salary for all employees whose salary is not in the range of $1500 and $2850. 8) Query to display Employee Name, Job, and Hire Date of all the employees hired between Feb 20, 1981 and May 1, 1981. Order the query in ascending order of Start Date. 9)

9) Query to display Employee Name & Department No. of all the employees in Dept 10 and Dept 30 in the alphabetical order by name. 10) Query to display Employee Name & Salary of employees who earned more than $1500 and are in Department 10 or 30. 11) Query to display Name & Hire Date of every Employee who was hired in 1981. 12) Query to display Name & Job of all employees who dont have a current Manager.

13) Query to display the Name, Salary & Commission for all the employees who earn commission. Sort the data in descending order of Salary and Commission. 14) Query to display Name of all the employees where the third letter of their name is A. 15) Query to display Name of all employees either have two Rs or have two As in their name & are either in Dept No = 30 or their Mangers Employee No = 7788.

16) Query to display Name, Job and Salary of all employees whose Job is Clerical or Analyst & their salaries are not equal to 1000, 3000, or 5000. 17) Query to display Name, Salary and Commission for all employees whose Commission Amount is greater than their Salary increased by 5 %. 18) Query to display the Current Date. 19) Query to display Employee No., Name, Salary and the Salary increased by 15 % expressed as a absolute whole number.20)Query to display Name, Hire Date and Salary Review Date which is the 1st Monday after six months of employment. 21) Query to display the employees that earn a salary that is higher than the salary of any of the clerks.

22) Query to display Name and calculate the number of months between today and the date each employee was hired. 23) Query to display the following for each employee:<E-Name> earns < Salary> monthly but wants < 3 * Current Salary >. Label the Column as Dream Salary. 24) Query to display Name and Salary for all employees. Format the salary to be 15 character long, left padded with $ sign. 25) Query to display Name with the 1st letter capitalized and all other letter lower case & length of their name of all the employees whose name starts with J,A and M. 26) Query to display Name, Hire Date and Day of the week on which the employee started. 27) Query to display Name and Commission Amount. If the employee does not earn commission then use default value No Commission.

28) Query to display Name, Department Name and Department No for all the employees. 29) Query to display Unique Listing of all Jobs that are in Department # 30. 30) Query to display Name, Department Name and Location for all employees earning a commission. 31) Query to display Name, Dept Name of all employees who have an A in their name. 32) Query to display Name, Job, Department No. and Department Name for all the employees working at the Dallas location. 33) Query to display Name and Employee No. along with their Managers Name and Managers employee no. 34) Query to display Name and Employee no. along with their Mangers Name and the Managers employee no; along with the Employees Name who do not have a Manager. 35) Query to display the Employee No, Name and Salary for all employees who earn than the average salary and who work in a Department with any employee with a T in his/her name. 36) Query to display Name, Dept No. & Salary of any employee whose department No. and salary matches both the department no. and the salary of any employee who earns a commission. 37) Query to display Name, Hire Date of any employee hired after the employee Blake was hired by the Company. 38) Query to display Name and Hire Dates of all Employees along with their Managers Name and Hire Date for all the employees who were hired before their managers. 39) Query to display Name and Salaries represented by Asteristisks Each asterisks (*) signifying $100. 40) Query to display the Highest, Lowest, Sum and Average Salaries of all the employees 41) Query to display Highest, Lowest, Sum and Average Salary for each unique Job Type 42) Query to display the number of employees performing the same Job type functions. 43) Query to display the no. of managers without listing their names. 44) Query to display the Difference b/w the Highest and Lowest Salaries.

45) Query to display the Managers No. & the Salary of the Lowest paid employee for that respective manager. Exclude anyone where the Manager ID is not known. Exclude any groups where the minimum salary is less than $1000. 46) Query to display the Department Name, Location Name, No. of Employees & the average salary for all employees in that department. 47) Query to display Name and Hire Date for all employees in the same dept. as Blake. 48) Query to display the Employee No. & Name for all employees who earn more than the average salary. 49) Query to display Employee Number & Name for all employees who work in a department with any employee whose name contains a T. 50) Query to display the employee name and salary of all employees who report to King. 51) Query to display the Department No, Name & Job for all employees in the Sales Dept. 52) Select manager name getting salary greater than average salary of employees in his department.

*Practicals related to Embedded SQL to be done using API or using pre-compiler will be sent soon.

CSHP 307: Software Lab based on STC 301 List of Exercises The goal of this lab is to develop data interpretation skills. Following exercises are designed to enable students to understand data characteristics either by visualization or by interpreting computed measures. All the excercises are to be completed using MS Excel functions and graphs. At the end of each exercise, the student should be able to draw a conclusion and state in a concise manner. Teachers are expected to guide students to obtain real data available through internet for the following exercises. Some suggested sites are: http://www.censusindia.gov.in/ http://www.visualizing.org/data/browse http://www.who.int/gho/publications/world_health_statistics/2012/en/in dex.html

Presentation of discrete data through frequency table, and different types of charts (Bar, Colum, Pie charts) 2. Presentation of data through multiple line chart, frequency polygon, ogive 3. Presentation of bivariate data through scatter-plot diagram. 4. Computation of measures of central tendency (Arithmetic mean, median, mode, Harmonic mean and geometric mean). 5. Measures of dispersion (Variance, standard deviation, mean deviation, range, minimum, maximum, coefficient of variation) 6. Calculation of first four raw and central moments through formula-bar. 7. Measure of skewness and kurtosis. 8. Fitting of binomial distribution and graphical representation of probabilities. 9. Fitting of Poisson distribution and graphical representation of
1.

probabilities. 10. Fitting of Normal distribution (expected normal frequencies). 11. Calculation of cumulative distribution function for normal distribution. 12. Fitting of exponential distribution and graphical representation of probabilities.

You might also like