Laboratory Manual. B. Sc. (Hons.) Computer Applications III Semester. Laboratory Course III: CCB 3P1

Similar documents
Laboratory Manual. B.Sc. Laboratory Course II II Semester. Department of Computer Science. Aligarh Muslim University Aligarh (CCB-2P1)

Laboratory Manual MCA I Semester

R13. II B. Tech I Semester Supplementary Examinations, May/June DATA STRUCTURES (Com. to ECE, CSE, EIE, IT, ECC)

Lab Manual B.Sc. (CA) SEMESTER - VI CCB-6P1: LABORATORY COURSE - VI DEPARTMENT OF COMPUTER SCIENCE ALIGARH MUSLIM UNIVERSITY ALIGARH

Introduction p. 1 Pseudocode p. 2 Algorithm Header p. 2 Purpose, Conditions, and Return p. 3 Statement Numbers p. 4 Variables p. 4 Algorithm Analysis

Laboratory Manual. Department of Computer Science Aligarh Muslim University, Aligarh. B. Sc. (Hons.) Computer Application I Semester

Table of Contents. Chapter 1: Introduction to Data Structures... 1

VALLIAMMAI ENGINEERING COLLEGE SRM Nagar, Kattankulathur

Section I. 1 Review of user defined function,recursion, pointer, structure 05 2 Introduction to Data Structures and stack

R10 SET - 1. Code No: R II B. Tech I Semester, Supplementary Examinations, May

TIME: 3 HOURS MARKS: a. Develop a java program to sort an array of N numbers in ascending order. (40)

Syllabus for Bachelor of Technology. Computer Engineering. Subject Code: 01CE0301. Subject Name: Data Structure. B.Tech. Year - II

VALLIAMMAI ENGINEERING COLLEGE

DATA STRUCTURES THROUGH C++

Sai Nath University. Assignment For MCA 2nd Sem.

MULTIMEDIA COLLEGE JALAN GURNEY KIRI KUALA LUMPUR

PROGRAMMING IN C++ (Regulation 2008) Answer ALL questions PART A (10 2 = 20 Marks) PART B (5 16 = 80 Marks) function? (8)

VALLIAMMAI ENGNIEERING COLLEGE SRM Nagar, Kattankulathur DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING QUESTION BANK

R10 SET - 1. Code No: R II B. Tech I Semester, Supplementary Examinations, May

CSCE 210/2201 Data Structures and Algorithms. Prof. Amr Goneid. Fall 2018

DYNAMIC MEMORY ALLOCATION AND DEALLOCATION

Home Works and Assignments

School of Computing & Information Technology. Department of Computer Science & Engineering LAB MANUAL CS-1331 DATA STRUCTURES LAB

CS 445: Data Structures Final Examination: Study Guide

Time: 3 HOURS Maximum Marks: 100

SRM UNIVERSITY FACULTY OF ENGINEERING AND TECHNOLOGY SCHOOL OF COMPUTING DEPARTMENT OF CSE COURSE PLAN. Sec. Name Office Office hour Mail id

OBJECT ORIENTED DATA STRUCTURE & ALGORITHMS

DEPARTMENT OF COMPUTER APPLICATIONS B.C.A. - FIRST YEAR ( REGULATION) SECOND SEMESTER LESSON PLAN SRM INSTITUTE OF SCIENCE AND TECHNOLOGY

Question Paper Code : 97044

WITH C+ + William Ford University of the Pacific. William Topp University of the Pacific. Prentice Hall, Englewood Cliffs, New Jersey 07632

Course Name: B.Tech. 3 th Sem. No of hours allotted to complete the syllabi: 44 Hours No of hours allotted per week: 3 Hours. Planned.

namibia UniVERSITY OF SCIEnCE AnD TECHnOLOGY

Revised time table of BCA (2011 admission) record submission

CSCE 210/2201 Data Structures and Algorithms. Prof. Amr Goneid

APJ ABDUL KALAM TECHNOLOGICAL UNIVERSITY THIRD SEMESTER B.TECH DEGREE EXAMINATION, JULY 2017 CS205: DATA STRUCTURES (CS, IT)

FORTH SEMESTER DIPLOMA EXAMINATION IN ENGINEERING/ TECHNOLIGY- MARCH, 2012 DATA STRUCTURE (Common to CT and IF) [Time: 3 hours

UCS-406 (Data Structure) Lab Assignment-1 (2 weeks)

LESSON PLAN B.C.A. - FIRST YEAR ( REGULATION) SECOND SEMESTER

STRUCTURE AND SYLLABUS APPROVED IN THE BOARD OF STUDIES MEETING ON 2001 TO BE EFFECTIVE FROM THE ACADEMIC YEAR

SAURASHTRA UNIVERSITY

Total No. of Questions :09] [Total No. of Pages : 02. II/IV B.Tech. DEGREE EXAMINATIONS, NOV/DEC First Semester CSE/IT DATA STRUCTURES USING C

E.G.S. PILLAY ENGINEERING COLLEGE (An Autonomous Institution, Affiliated to Anna University, Chennai) Nagore Post, Nagapattinam , Tamilnadu.

PRACTICAL LIST FOR EVEN SEMESTERS (PGDCA/MCA/MSC (CS))

INSTITUTE OF AERONAUTICAL ENGINEERING

CS2013 Course Syllabus Spring 2018 Lecture: Mon/Wed 2:00 P.M. 2:50 P.M. SH C259 Lab: Mon/Wed 2:50 P.M. 4:00 P.M. SH C259

( ) + n. ( ) = n "1) + n. ( ) = T n 2. ( ) = 2T n 2. ( ) = T( n 2 ) +1

CS301 - Data Structures Glossary By

Code No: R Set No. 1

AP Computer Science AB

During the first 2 weeks of class, all students in the course will take an in-lab programming exam. This is the Exam in Programming Proficiency.

1 P a g e A r y a n C o l l e g e \ B S c _ I T \ C \

12 Abstract Data Types

CISC 3130 Data Structures Spring 2018

PESIT Bangalore South Campus Department of MCA Course Information for

CLO Assessment CLO1 Q1(10) CLO2 Q2 (10) CLO3 Q4 (10) CLO4 Q3a (4)

Delhi Noida Bhopal Hyderabad Jaipur Lucknow Indore Pune Bhubaneswar Kolkata Patna Web: Ph:

End-Term Examination Second Semester [MCA] MAY-JUNE 2006

SYLLABUS Type of evaluation

Algorithm Class. C C++ DS JAVA DATA STRUCTURES TRAINING INSTITUTE KPHB HYDERABAD. Mobile:

logn D. Θ C. Θ n 2 ( ) ( ) f n B. nlogn Ο n2 n 2 D. Ο & % ( C. Θ # ( D. Θ n ( ) Ω f ( n)

Model 4.2 Faculty member + student Course syllabus for Advanced programming language - CS313D

Discuss the following operations on One-Dimensional array with algorithms.

DATA STRUCTURE : A MCQ QUESTION SET Code : RBMCQ0305

( ) ( ) C. " 1 n. ( ) $ f n. ( ) B. " log( n! ) ( ) and that you already know ( ) ( ) " % g( n) ( ) " #&

FORTH SEMESTER DIPLOMA EXAMINATION IN ENGINEERING/ TECHNOLIGY- OCTOBER, 2012 DATA STRUCTURE

MAHARAJA KRISHNAKUMARSINHJI BHAVNAGAR UNIVERSITY NAAC Accreditation Grade B (With effect from Academic Year: )

Data_Structures - Hackveda

CS-301 Data Structure. Tariq Hanif

( ). Which of ( ) ( ) " #& ( ) " # g( n) ( ) " # f ( n) Test 1

Prepared By: Ms. Nidhi Solanki (Assist. Prof.) Page 1

Data Structures in C++ Using the Standard Template Library

CS DATA STRUCTURES AND ALGORITHMS

CompuScholar, Inc. Alignment to Nevada "Computer Science" Course Standards

General Instructions. You can use QtSpim simulator to work on these assignments.

CS503 Advanced Programming I CS305 Computer Algorithms I

List of Practical for Class XII Computer Science

CS302 Data Structures using C++

SECOND SEMESTER JAVA PROGRAMMING

CS2013 Course Syllabus Spring 2017 Lecture: Friday 8:00 A.M. 9:40 A.M. Lab: Friday 9:40 A.M. 12:00 Noon

Quantitative Finance COURSE NUMBER: 22:839:615 COURSE TITLE: Special Topics Oriented Programming 2

Reg. No. : Question Paper Code : 27157

Largest Online Community of VU Students

MID TERM MEGA FILE SOLVED BY VU HELPER Which one of the following statement is NOT correct.

Preface... (vii) CHAPTER 1 INTRODUCTION TO COMPUTERS

Objective Questions for Online Practical Exams under CBCS Scheme Subject: Data Structure-I (CS-113)

Note: Select one full question from each unit

KRISHNA KANTA HANDIQUI STATE OPEN UNIVERSITY Hiranya Kumar Bhuyan School of Science and Technology

July 2012 Masters in Computer Application (MCA) - Semester 2 MCA 2010 Operating System 4 Credits

FINALTERM EXAMINATION Fall 2009 CS301- Data Structures Question No: 1 ( Marks: 1 ) - Please choose one The data of the problem is of 2GB and the hard

OCR H446 A-Level Computer Science

Cpt S 122 Data Structures. Course Review FINAL. Nirmalya Roy School of Electrical Engineering and Computer Science Washington State University

PROGRAMMING IN C AND C++:

& ( D. " mnp ' ( ) n 3. n 2. ( ) C. " n

Hrs Hrs Hrs Hrs Hrs Marks Marks Marks Marks Marks

1) What is the primary purpose of template functions? 2) Suppose bag is a template class, what is the syntax for declaring a bag b of integers?

Draw a diagram of an empty circular queue and describe it to the reader.

KRISHNA KANTA HANDIQUI STATE OPEN UNIVERSITY Hiranya Chandra Bhuyan School of Science and Technology

MCA SEM-II Data Structure

Announcements. Last modified: Thu Nov 29 16:15: CS61B: Lecture #40 1

DATA STRUCTURES USING C

Transcription:

Laboratory Manual B. Sc. (Hons.) Computer Applications III Semester Laboratory Course III: CCB 3P1 Department of Computer Science Aligarh Muslim University, Aligarh

Credits Lab Manual Design Committee: Prof. Mohammad Ubaidullah Bokhari Dr. Arman Rasool Faridi Dr. Faisal Anwar Dr. Aasim Zafar (Convener) The Committee thankfully acknowledges the efforts and contributions of the following teachers: Dr. Mohammad Nadeem Mr. Sunil Kumar Sharma Mr. Imshad Ahmad Khan Mr. Naved Iqbal Design & Compilation: Mr. Sunil Kumar Sharma First Edition: July 2017 Approved by BoS, Dated 31/07/2017 Department of Computer Science, A.M.U., Aligarh, (U.P.), India LAB MANUAL/CCB 3P1/DoCS- Page 2

COURSE TITLE: Laboratory Course-III COURSE CODE: CCB 3P1 CREDIT: 2 PERIODS PER WEEK: 3 CONTINUOUS ASSESSMENT: 40 EXAMS: 60 COURSE DESCRIPTION This course is designed to review the concepts of C++ language, studied in previous semester and implement the various algorithms related to different data structures. CONTENT This course is designed to provide the students the opportunity of learning both concepts of C++ and then implementing algorithms and data structures. This course is indented to develop a deep understanding of various operations on data structure such as searching, sorting, insertion, deletion and traversing. This course is designed to help students in: Learning OOP concepts using C++. Learning different sorting (Bubble Sort, Insertion Sort, Merge Sort, Heap Sort, Quick Sort) and searching (Linear and Binary) techniques using C++. Learning Linked List, Queue, Stack and their operations using C++. Learning non-linear data structures such as Binary Tree, Binary Search Tree etc. and their operations using C++. Learning Graphs and their operations using C++. LAB MANUAL/CCB 3P1/DoCS- Page 3

After completing this course, the students would be able to: Understand and implement OOP concepts using C++. Understand and implement different sorting (Bubble Sort, Insertion Sort, Merge Sort, Heap Sort, Quick Sort) and searching (Linear and Binary) techniques using C++. Understand and implement Linked List, Queue, Stack and their operations using C++. Understand and implement non-linear data structures such as Binary Tree, Binary Search Tree etc. and their operations using C++. Understand and implement Graphs and their operations using C++. RULES AND REGULATIONS Students are required to strictly adhere to the following rules. The students must complete the weekly activities/assignments well in time (i.e., within the same week). The students must maintain the Lab File of their completed activities/assignments in the prescribed format (Appendix-1). The students must get the completed weekly activities/assignments checked and signed by the concerned teachers in the Lab in the immediate succeeding week. Failing LAB MANUAL/CCB 3P1/DoCS- Page 4

which the activities/assignments for that week will be treated as incomplete. At least TEN (10) such timely completed and duly signed weekly activities/assignments are compulsory, failing which students will not be allowed to appear in the final Lab Examination. The students need to submit the following three deliverables for each exercise duly signed by the Teacher: Algorithm Flow Chart Coding Input /Output Each question will be evaluated on a scale of 10 points, 4 for Algorithm, 3 for Flow Chart and 3 for Coding part. The students need to ensure that each question is assessed and signed by the Teacher in the week/time. Late submission would not be accepted after the due date. Cooperate, collaborate and explore for the best individual learning outcomes but copying is strictly prohibited. LAB MANUAL/CCB 3P1/DoCS- Page 5

WEEK #3 WEEK #2 WEEK #1 APPENDIX-1 Template for the Index of Lab File S. No. S DATE OF SUBMISSION SIGNATURE OF THE TEACHER REMARKS 1# 1 2# 3# 1# 2 2# 3# 1# 3 2# 3# Note: The students should use Header and Footer mentioning their roll no. & name in footer and page no in header. LAB MANUAL/CCB 3P1/DoCS- Page 6

WEEK #1 LAB 1-2-3 To understand concept of control construct, arrays, recursion, string functions and pointers. the concepts of control construct arrays, recursion, string functions and pointers. Scenario: A courier company has number of items to be delivered to its intended customers through its salesman. The salesman visits following cities to deliver the respective items: S. NO. CITIES NO. OF ITEMS 1. Aligarh 18 2. Agra 25 3. Baroda 13 4. Banaras 43 5. Chennai 8 6. New Delhi 67 7. New Jalpaiguri 29 8. Howrah 11 9. Kolkata 56 10. Mumbai 33 Solve the following problems based on the above mentioned scenario using C++: 1. Write a program to store and display the above mentioned cities and corresponding items using arrays. LAB MANUAL/CCB 3P1/DoCS- Page 7

2. Write a program to display name of cities where salesman has delivered maximum and minimum number of items. 3. Write a program to search the number of items to be delivered of a user supplied city. LAB MANUAL/CCB 3P1/DoCS- Page 8

WEEK #2 LAB 4-5-6 To understand concept of control construct, arrays, recursion, string functions and pointers (continues...). the concepts of control construct arrays, recursion, string functions and pointers (continues...). Based on the previous scenario, do the followings: 1. Write a program to find total number of items delivered using recursive function additem(). 2. Write a program to display name of the cities along with their length, and identity cities composed of two words. 3. The number of items of Agra and Kolkata are accidently interchanged. Correct them by writing a swap function using pointers. LAB MANUAL/CCB 3P1/DoCS- Page 9

WEEK #3 LAB 7-8-9 To understand concept of class, inheritance, operator overloading and file handling. the concepts of class, inheritance, operator overloading and file handling. Scenario: A university has different entities such as Department, Programs and Student whose data members and member functions are given below: Teacher- { Data Members: Name, department, hours, programstaught; Member Function: setdetails(), getdetails()} Program- {Data Members: Name, department, duration; Member Functions: setdetails(), getdetails()} Student- {Data Members: Name, RollNo, Program, Department} Member Function: setdetails(), getdetails()} Solve the following problems based on the above mentioned scenario using C++: 1. Write a program to create Teacher, Program and Student Classes with above mentioned data members and member functions. 2. Add following functionalities in the above program; the default department of Teacher, Program and Student should be Computer Science ; however a different department could be assigned at run time. 3. Write a program to overload + operator to add the hours of two teachers. 4. Write a program to create two subclasses Residential Student and Non- Residential Student inherited from Student class. Residential Student would LAB MANUAL/CCB 3P1/DoCS- Page 10

have a data member Hall of Residence and Non-Residential Student would have Address as its data member. LAB MANUAL/CCB 3P1/DoCS- Page 11

WEEK #4 LAB 10-11-12 To understand concept of class, inheritance, operator overloading and file handling (continues ). the concepts of class, inheritance, operator overloading and file handling (continues ). Based on the previous scenario, do the followings: 1. Write a friend function to determine number of hours taught by a particular teacher. 2. Write a program to store details of Teacher, Program and Student, each in a separate file. 3. Write a program to read details of Student from file whose Roll No is given by the user? LAB MANUAL/CCB 3P1/DoCS- Page 12

WEEK #5 LAB 13-14-15 To understand concept of function template and class template. the concepts of function template and class template. 1. Write a function to swap two numbers using function template. The numbers could be Integer or float that depends on the user inputs. 2. Create a class Matrix that has matric data members and getvalue(), setvalue() as member functions. Write a program to perform Matrix operations (2-D array implementation), Add and Multiplication using class template. LAB MANUAL/CCB 3P1/DoCS- Page 13

WEEK #6 LAB 16-17-18 To learn linear and binary search techniques. and implement linear and binary search methods in a given list. 1. Write a C++ program to search an element in a given 2D array of integers. 2. Write a C++ program to implement Binary search on 1D array of Employee structure (contains employee_name, emp_no, emp_salary), with key as emp_no. And count the number of comparison happened. LAB MANUAL/CCB 3P1/DoCS- Page 14

WEEK #7 LAB 19-20-21 To learn Bubble and Selection sorting techniques. and implement Bubble and Selection sort. 1. Write a C++ Program to sort a given list of Integers using Bubble sort technique. 2. Write a C++ Program to sort a given list of Integers using Selection sort technique. LAB MANUAL/CCB 3P1/DoCS- Page 15

WEEK #8 LAB 22-23-24 To learn Insertion and Quick sorting techniques. and implement Insertion and Quick sort. 1. Write a C++ Program to sort a given list of Integers using Insertion sort technique. 2. Write a C++ Program to sort a given list of Integers using Quick sort technique. LAB MANUAL/CCB 3P1/DoCS- Page 16

WEEK #9 LAB 25-26-27 To learn how to create a linked list and perform different operations on it using pointer concepts. and implement linked list and perform its different operations using pointer concepts. 1. Write a C++ program to create a Linked List and perform the following operations: a. Function called InsertAtMiddle to add node in the middle of list. b. Function called InsertBefore to add node before Nth node. c. Function called InsertEnd to add node at the tail of linked list. d. Function called DeleteAfter to delete node after Nth node. e. Function called DeleteNode to delete a node having specific value. 2. Write a C++ program to append a Linked List L2 into a given Linked List L1. L1 contains N1 nodes with header H1 and L2 contains N2 nodes with header H2. LAB MANUAL/CCB 3P1/DoCS- Page 17

WEEK #10 LAB 28-29-30 To learn how to create a linked list and perform different operations on it using pointer concepts (continues ). and implement linked list and perform its different operations using pointer concepts (continues...). 1. Write a C++ program that reverses a given list L with header H while traversing it only once. Each node should point to the node that was previously its predecessor; the head should point to the node that was previously at the end and the node that was previously at beginning should be last node. 2. Write a C++ program to implement circular doubly linked list and perform the following operations: a. Adding node to the linked list b. Traversing the whole list c. Deleting nodes from the list LAB MANUAL/CCB 3P1/DoCS- Page 18

WEEK #11 LAB 31-32-33 To learn how to create Stack and perform its different operations. and implement Stack and perform its different operations. 1. Write a C++ program to create a Stack and perform the following operations: a. push an Element to the stack b. pop an element from stack 2. Write a C++ program to implement a 4-stacks of size m in an array of size n with all the basic operations such as IsEmpty(i), Push(i), Pop(i), IsFull(i) where i denotes the stack number (1,2,3,4), m n/4. Stacks are not overlapping each other. Leftmost stack facing the left direction and other three stacks are facing in the right direction. LAB MANUAL/CCB 3P1/DoCS- Page 19

WEEK #12 LAB 34-35-36 To learn some of the applications of Stack. the practical usage of Stack with the help of implementing its some applications. 1. Write a C++ program to check whether an expression has balanced parentheses using array implementation of a stack. 2. Write a C++ program to evaluate a postfix expression using array implementation of a stack. LAB MANUAL/CCB 3P1/DoCS- Page 20

WEEK #13 LAB 37-38-39 To learn how to create Queue and perform its different operations. and implement Queue and perform its different operations. 1. Write a C++ program to create a Queue and perform the following operations: a. Insert an Element from Queue b. Delete an element from Queue 2. Write a C++ program to move all the items from a queue onto stack. LAB MANUAL/CCB 3P1/DoCS- Page 21

WEEK #14 LAB 40-41-42 To learn the concept of Binary tree, Binary Search Tree and their different functions. and implement Binary tree, Binary Search Tree and their different functions. 1. Write a C++ program to implement Binary tree insertion. 2. Write a C++ program to implement Post-order, pre-order and In-order traversal of the Binary tree. LAB MANUAL/CCB 3P1/DoCS- Page 22

WEEK #15 LAB 43-44-45 To learn the concept of Binary Tree, Binary Search Tree and their different functions (continues ). and implement Binary Tree, Binary Search Tree and their different functions (continues ). 1. Write a C++ program for Binary Search Tree to implement following operations: a. Insertion b. Finding an element c. Finding Min element d. Finding Max element. LAB MANUAL/CCB 3P1/DoCS- Page 23

WEEK #16 LAB 46-47-48 To learn the concepts of Graph and their different functions. and implement Graph and their different functions. 1. Write a C++ program to implement graph using array and linked-list. 2. Write a C++ program to implement Breadth-First and Depth-First Traversal of Graphs. 3. Write a C++ program to implement Dijkstra s Single Source Shortest Path Algorithm. LAB MANUAL/CCB 3P1/DoCS- Page 24