• No results found

Computer Lab Manual

N/A
N/A
Protected

Academic year: 2022

Share "Computer Lab Manual"

Copied!
31
0
0

Loading.... (view fulltext now)

Full text

(1)Look forward, learn modern knowledge, and do not waste time in studies of old subjects of no values.. B.Sc. (C.A.) Semester-II. Computer Lab Manual. 2019-20. CCB-2P1: PRACTICAL LAB - II. DEPARTMENT OF COMPUTER SCIENCE ALIGARH MUSLIM UNIVERSITY ALIGARH.

(2) CREDITS Lab Manual Design Committee:  Prof. Mohammad Ubaidullah Bokhari  Dr. Arman Rasool Faridi  Dr. Faisal Anwar  Dr. Aasim Zafar. (Convener). Editor:  Dr. Aasim Zafar 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.

(3) COURSE TITLE: Practical Lab -II CREDIT: 02 CONTINUOUS ASSESSMENT: 40. COURSE CODE: CCB – 2P1 PERIODS PER WEEK: 03 EXAMS: 60. COURSE DESCRIPTION This manual is intended for the Second year students in the subject of Programming with Python.. This manual typically contains practical/Lab. Sessions related to Programming with Python covering various aspects in order to enhance subject understanding. Python is a general purpose, high-level programming language; other high-level languages you might have heard of C++, PHP, and Java. Virtually all. modern. programming. languages. make. us. of. an. Integrated. Development Environment (IDE), which allows the creation, editing, testing, and saving of programs and modules. In Python, the IDE is called IDLE (like many items in the language, this is a reference to the British comedy group Monty Python, and in this case, one of its members, Eric Idle). Many modern languages use both processes. They are first compiled into a lower level language, called byte code, and then interpreted by a program called a virtual machine. Python uses both processes, but because of the way programmers interact with it, it is usually considered an interpreted language. There are two ways to use the Python interpreter: shell mode and script mode. In shell mode, you type Python statements into the Python shell and the interpreter immediately prints the result. In script mode, you type statements into the editor and save it in a file known as script. The interpreter executes the. 2. AMU. LAB MANUAL/B.Sc. (CA)/CCB–2P1/CSD-AMU/JAN2020. CSD. AMU. code of the script..

(4) Students are advised to thoroughly go through this manual rather than only topic mentioned in the syllabus as practical aspects are the key to understanding and conceptual visualization of theoretical aspects covered in the books. Also, this course is designed to review the concepts of Data Structure using C, studied in previous semester and implement the various algorithms related to different data structures. Good Luck for your Enjoyable Laboratory Sessions.. CONTENT This course is designed to provide the students the opportunity of learning both – concepts of C, implementing algorithms of data structures and programming with Python. This course is indented to develop a deep understanding of various operations on data structure such as searching, sorting, insertion, deletion and traversing and provides students the idea of. new. programming language. Apart from basic concepts, it helps to understand the concept of lists, tuples, dictionaries and file handling.. OBJECTIVES This course is designed to help students in: . Learning the concepts of different data structures using C.. . Learning different sorting (Bubble Sort, Insertion Sort, Merge Sort, Heap Sort, Quick Sort) and searching (Linear and Binary) techniques using C.. LAB MANUAL/B.Sc. (CA)/CCB–2P1/CSD-AMU/JAN2020. 3. AMU. Learning Linked List, Queue, Stack and their operations using C.. CSD. AMU. .

(5) . 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.. . Learning Python programming. OUTCOMES After completing this course, the students would be able to: . Understand and implement the different data structure 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.. . Write, debug and execute Python programs to solve various problems.. 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. 4. AMU. LAB MANUAL/B.Sc. (CA)/CCB–2P1/CSD-AMU/JAN2020. CSD. AMU. activities/assignments in the prescribed format (Appendix-1)..

(6) . 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 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. 5. AMU. LAB MANUAL/B.Sc. (CA)/CCB–2P1/CSD-AMU/JAN2020. CSD. AMU. outcomes but copying is strictly prohibited..

(7) APPENDIX-1. PROBLEMS WITH DESCRIPTION. PAGE NO.. WEEK NO.. Template for the Index of Lab File SIGNATURE OF THE TEACHER WITH DATE. 1# 1. 2# 3# 1#. 2. 2# 3# 1#. 3. 2# 3# 1#. 4. 2# 3#. Note: The students should use Header and Footer mentioning their roll no. &. 6. AMU. LAB MANUAL/B.Sc. (CA)/CCB–2P1/CSD-AMU/JAN2020. CSD. AMU. name in footer and page no in header..

(8) WEEK #1 OBJECTIVES.  To understand concept of control construct, arrays, recursion, string functions and pointers in C.  To learn the following in Shell and Script mode: The basic printing command is print.  Different operators (+, -, *, /, %).  Integer and floating number arithmetic.. OUTCOMES.  PEDMAS Law. After completing this, the students would be able:  to understand the concepts of control construct arrays, recursion, string functions and pointers in C.  to write and run a simple Python statement/ programs in Shell and Script mode.. Note: When naming a Python program, a .py extension must be used. Failing to do so will result in code that will not be recognized by the system as a Python program.. PROBLEMS. S. 1#. 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.

(9) 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: a) Write a program to store and display the above mentioned cities and corresponding items using arrays. b) Write a program to display name of cities where salesman has delivered maximum and minimum number of items. c) Write a program to search the number of items to be delivered of a user supplied city. 2#. Use interactive Shell to print the Hello Example: print ‘Hello, World’. 3#. Start the Python interpreter and use it as a calculator i.e. Use interactive shell to perform the following operations 2. 4#. + 3, 5*3, 7-2, 6/2, 6/4, 6%4, 6%2, 2*4-3, 4-2*6-4. Write a program in Python programming and save it firstProgram.py to perform the following operations: 2. 5#. + 3, 5*3, 7-2, 6/2, 6/4, 6%4, 6%2. Write a program in Python programming and save it second Program.py to display the following messages “Hello World, Python is High level, General-purpose Programming language” “ Guido Van Rossum invented the Python programming language in 1990s”. 8. AMU. LAB MANUAL/B.Sc. (CA)/CCB–2P1/CSD-AMU/JAN2020. CSD. AMU. ..

(10) WEEK #2  To understand concept of control construct, arrays, recursion, string functions and pointers using C (continues...).. OBJECTIVES.  To learn different data types (int, float and string) in Python.  To learn the rules to define variables in Python.  To learn the use of Assignment (=) and comparison (==) operators in Python.  To learn the special use of + for string concatenation in Python.  To learn the basic input receiving command is raw_input in Python.. OUTCOMES. After completing this, the students would be able:  to understand the concepts of control construct arrays, recursion, string functions and pointers using C (continues...).  to learn how to input character, variables/keywords, evaluate expressions.. Note: To Learn three basic types of simple variables in Python: integers (whole numbers, commonly used as an index), floats (that is, numbers with a decimal point, AKA real numbers), and strings (collections of alphanumeric characters such as names, sentences, or numbers that are not manipulated mathematically such as a part number or zip code). The first assignment to a variable creates it. The variable types don’t need to be declared. Python figures out the variable types on its own.. PROBLEMS. S. LAB MANUAL/B.Sc. (CA)/CCB–2P1/CSD-AMU/JAN2020. 9. AMU. Based on the previous scenario, do the followings using C:. CSD. AMU. 1#.

(11) a) Write a program to find total number of items delivered using recursive function additem(). b) Write a program to display name of the cities along with their length, and identity cities composed of two words. c) The number of items of ‘Agra’ and ‘Kolkata’ are accidently interchanged. Correct them by writing a swap function using pointers. 2#. Write a program to find SUM and MULTIPLY of any three numbers.. 3#. Write a program to find the average of any five numbers.. 4#. Write a program to find simple interest.. 5#. Write a program to convert Celsius into Fahrenheit temperature.. 6#. Write a program to find perimeter of Rectangle.. 7#. Write a program to find circumference of Circle.. 8#. The volume of a sphere with radius r is 43 πr 3. Write a Python program which accepts the radius of a sphere and computes the volume. What is the volume of a sphere with radius 5?. 9#. Suppose the cover price of a book is Rs 240.95, but bookstores get a 40% discount. Shipping costs Rs 30 for the first copy and 75 cents for each additional copy. What is the total wholesale cost for 60 copies?. 10#. Write a Python program which accepts the radius of a circle from the user and. 10. AMU. LAB MANUAL/B.Sc. (CA)/CCB–2P1/CSD-AMU/JAN2020. CSD. AMU. compute the area..

(12) WEEK #3 OBJECTIVES. . To understand concept of class, inheritance, operator overloading and file handling using C.. . To learn the concept of function in Python.. . To learn Built-in functions: Type conversion and Math functions in Python.. . To learn the user-defined functions: Definitions and use in Python.. . To learn the Function: Flow of execution, parameters and arguments and fruitful and void functions in Python.. OUTCOMES. After completing this, the students would be able: . to understand the concepts of class, inheritance, operator overloading and file handling using C .. . to write, debug and run a simple Python functions.. . to learn how to define user-defined functions and pass arguments to functions in Python.. PROBLEMS. S. 1#. 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()}. 11. AMU. LAB MANUAL/B.Sc. (CA)/CCB–2P1/CSD-AMU/JAN2020. CSD. AMU. Solve the following problems based on the above mentioned scenario using C:.

(13) a) Write a program to create Teacher, Program and Student Classes with above mentioned data members and member functions. b) 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. c) Write a program to overload ‘+’ operator to add the hours of two teachers. d) Write a program to create two subclasses ‘Residential Student’ and ‘Non-Residential Student’ inherited from Student class. ‘Residential Student’ would have a data member ‘Hall of Residence’ and ‘Non-Residential Student’ would have ‘Address’ as its data member. 2#. Write a Python program which accepts the inputs from the user and do the following using functions. a) To find largest of 3 numbers.(Function) b) To generate first 4th Fibonacci term.(function) c) To compute factorial of an integer n recursively.(function) d) To find volume of cylinder or cube or rectangular box. e) To find area of rectangle. f) To find circumference of circle.(Using constructor) g) To exchange the values of two variables. 12. AMU. LAB MANUAL/B.Sc. (CA)/CCB–2P1/CSD-AMU/JAN2020. CSD. AMU. h) To find the distance between two points..

(14) WEEK #4 OBJECTIVES. . To understand concept of class, inheritance, operator overloading and file handling using C (continues…).. . To learn Boolean Expression in Python.. . To learn the logical operators, relational operators.. . To learn the Conditional (if), Alternative (if-else).. . To learn the Chained conditional (if-elif-else), Nested Conditional.. OUTCOMES. After completing this, the students would be able:  to understand the concepts of class, inheritance, operator overloading and file handling using C(continues…).  to write, debug and run a simple Python programs based on conditions.. PROBLEMS. S 1#. Based on the previous scenario, do the followings: a) Write a friend function to determine number of hours taught by a particular teacher. b) Write a program to store details of Teacher, Program and Student, each in a separate file. c) Write a program to read details of Student from file whose Roll No is given by the. Write a program to find the greatest of three numbers.(use only if Statement). 3#. Write a program to find smallest of three number.(use if and else statement). 4#. Write a program to check the given no that is even or odd.(use if and else). 5#. Write a program to check a year for leap year.( use if and else). 6#. Write a program to print number of days in a month.(Chained Conditional). LAB MANUAL/B.Sc. (CA)/CCB–2P1/CSD-AMU/JAN2020. 13. AMU. 2#. CSD. AMU. user?.

(15) 7#. Write a program to find the area of triangle and show its type.( use if and else). 8#. Write a program which takes a character as input from the keyboard and convert it into capital letter if it is a small letter and Vice-Versa.(if –else). 9#. Write a Python program to find those numbers which are divisible by 7 and multiple of 5, between 1500 and 2700 (both included).. 10#. Write a program that ask the user for a number. Depending on whether the number is. 14. AMU. LAB MANUAL/B.Sc. (CA)/CCB–2P1/CSD-AMU/JAN2020. CSD. AMU. even or odd, print out an appropriate message to the user..

(16) OBJECTIVES. WEEK #5  To understand concept of function template and class template using C.  To learn definite iteration (For loop) and conditional iteration (While loop) in Python.  To learn the Conditional (if), Alternative (if-else), break and pass statements in Python.  To learn the recursion, flow of execution, infinite recursion in. OUTCOMES. Python.. After completing this, the students would be able to: . to understand the concepts of function template and class template using C.. . to write, debug and run a simple Python functions based on iteration and recursion.. PROBLEMS. S 1#. Write a function in C 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 in C to perform Matrix operations (2-D array. Write a program in Python to check a number for Armstrong. (while). 4#. Write a program in Python to print factorial of a number.(for). 5#. Write a program in Python to generate first n Fibonacci terms recursively.(function). 6#. Write a program in Python to compute factorial of an integer n recursively.(function). LAB MANUAL/B.Sc. (CA)/CCB–2P1/CSD-AMU/JAN2020. 15. AMU. 3#. CSD. AMU. implementation), Add and Multiplication using class template..

(17) 7#. Write a program in Python that asks the user how many Fibonnaci numbers to generate and then generates them. Take this opportunity to think about how you can use functions. (Without recursion). 8#. Write a program in Python to print the following Pattern.(for) *. 9#. *. *. *. *. *. *. *. *. *. Write a program to print the following Pattern.(for) A A B C A B C D E ……... N-lines. 10#. Write a program to print the following Pattern.(for) 1. 11#. 2. 2. 3. 3. 3. 4. 4. 4. 4. 5. 5. 5. 5. 5. Write a Python program to construct the following pattern, using a nested for loop. * *. *. *. *. *. *. *. *. *. *. *. *. *. *. *. *. *. *. *. *. *. *. *. 16. AMU. LAB MANUAL/B.Sc. (CA)/CCB–2P1/CSD-AMU/JAN2020. CSD. AMU. *.

(18) OBJECTIVES. WEEK #6 . To learn linear and binary search techniques using C.. . To learn the concept of string in Python.. . To learn the different String functions and methods.. OUTCOMES. After completing this, the students would be able to: . understand and implement linear and binary search methods in a given list.. . To access individual characters in a string.. . To retrieve a substring from a string.. . Top search for a substring in a string.. . To use string methods to manipulate strings.. PROBLEMS. S. 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.. 3#. Assume that the variable data refers to the string “Python rules!”. Use a string methods to perform the following tasks: a. Obtain a list of the words in the string. b. Convert the string to uppercase. c. Locate the position of the string “rules”. d. Search a given character. 17. AMU. LAB MANUAL/B.Sc. (CA)/CCB–2P1/CSD-AMU/JAN2020. CSD. AMU. e. Replace the exclamation point with a question mark..

(19) 4#. Write a Python program to determine the length of the given string.. 5#. Write a Python program to count the number of characters (character frequency) in a string.. 6#. Write a Python program to reverse the order of the characters in the given string.. 7#. Write a Python program to get a string made of the first 2 and the last 2 chars from a given a string. If the string length is less than 2, return instead of the empty string.. 8#. Write a Python program which accepts the user's first and last name and print them in reverse order with a space between them.. 9#. Write a Python program to calculate the length of a string.. 10#. Write a program (using functions!) that asks the user for a long string containing multiple words. Print back to the user the same string, except with the words in backwards order. For example, say I type the string: My name is Michele Then the output will be: Michele is name My.. 11#. Ask the user for a string and print out whether this string is a palindrome or not. (A. 18. AMU. LAB MANUAL/B.Sc. (CA)/CCB–2P1/CSD-AMU/JAN2020. CSD. AMU. palindrome is a string that reads the same forwards and backwards.).

(20) OUTCOMES. OBJECTIVES. WEEK #7 . To learn Bubble and Selection sorting techniques using C.. . To learn about list and its associated operations in Python.. . To learn the various list operations (Map, filter and reduce)in Python.. . After completing this, the students would be able to:  to understand and implement Bubble and Selection sort using C.  to construct lists and access items in those lists.  to use methods to manipulate lists.  to perform traversals of lists to process items in the lists  to define simple functions that expect parameters and return values.. PROBLEMS. S 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.. 3#. Write a Python program to create an array of 5 integers and display the List items. Access individual element through indexes.. 4#. Write a Python program to reverse the order of the items in the array.. 5#. Write a Python function to sum all the numbers in a list.. 6#. Write a Python function to multiply all the numbers in a list.. 7#. Take a list, say for example this one a = [1, 1, 2, 3, 5, 8, 13, 21, 34, 85 ]. 19. AMU. LAB MANUAL/B.Sc. (CA)/CCB–2P1/CSD-AMU/JAN2020. CSD. AMU. a) Write a program that prints out all the elements of the list that are less than 5..

(21) b) Instead of printing the elements one by one, make a new list that has all the elements less than 5 from this list in it and print out this new list. c) Ask the user for a number and return a list that contains only elements from the original list a that are smaller than that number given by the user. 8#. Let’s say I give you a list saved in a variable: a = [1, 4, 9, 16, 25, 36, 49, 64, 81, 100]. Write one line of Python that takes this list a and makes a new list that has only the even elements of this list in it.. 9#. Write a program to find the sum of n numbers. (List). 10#. Write a program to find the average of n numbers.(List). 11#. Write a program to find maximum/minimum value of n numbers.(List). 12#. Write a program to search a given element in the list.. 13#. Write a program to sort the given list of elements.. 14#. Write a program to perform binary search.. 15#. Write a function called most_frequent that takes a string and prints the letters in decreasing order of frequency. Find text samples from several different languages. 20. AMU. LAB MANUAL/B.Sc. (CA)/CCB–2P1/CSD-AMU/JAN2020. CSD. AMU. and see how letter frequency varies between languages..

(22) OUTCOMES. OBJECTIVES. WEEK #8 . To learn Insertion and Quick sorting techniques using C.. . To learn about dictionary, how to create a dictionary.. . To learn the various dictionary operations and methods.. . To learn the reverse search method. .. After completing this, the students would be able:    . to understand and implement Insertion and Quick sort. to construct dictionaries and access entries in those dictionaries to use methods to manipulate dictionaries to decide whether a list or a dictionary is an appropriate data structure for a given application.. PROBLEMS. S. 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.. 3#. Assume that the variable data refers to the dictionary {“b”:20, “a”:35}.. data[“a”]. . data.get(“c”, None). . len(data). . data.keys(). . data.values(). . data.pop(“b”). LAB MANUAL/B.Sc. (CA)/CCB–2P1/CSD-AMU/JAN2020. 21. AMU. . CSD. AMU. Write the values of the following expressions:.

(23) 4#. Assume that the variable data refers to the dictionary {“b”:20, “a”:35}. Write the expressions that perform the following tasks: a) Replace the value at the key “b” in data with that value’s negation. b) Add the key/value pair “c”:40 to data. c) Remove the value at key “b” in data, safely. d) Print the keys in data in alphabetical order.. 5#. Write a python program to read a string and count how many times each letter appears. (Histogram). 6#. Write a python program to create a dictionary, read a value from the user and search the key element (Reverse lookup).. LAB MANUAL/B.Sc. (CA)/CCB–2P1/CSD-AMU/JAN2020. 22. AMU. Write a python program to create two dictionaries and merge them.. CSD. AMU. 7#.

(24) WEEK #9 OBJECTIVES.  To learn how to create a linked list and perform different operations on it using pointer concepts.  To learn the concept of file and its associated operations in Python.  To learn File handling methods.  To learn Format operator.  To learn Handling exceptions.. OUTCOMES. After completing this, the students would be able:  to understand and implement linked list and perform its different operations using pointer concepts.  to write, debug and run program that handles file.. PROBLEMS. S 1#. 2#. 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.. 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.. 3#. Write a code segment that opens a file named myfile.txt for input and prints the. 23. AMU. LAB MANUAL/B.Sc. (CA)/CCB–2P1/CSD-AMU/JAN2020. CSD. AMU. number of lines in the file..

(25) 4#. Write a code segment that opens a file for input and prints the number of four-letter words in the file.. 5#. Write a python program which reads itself and prints the number of lines in the file.. 6#. Write a python program which reads an integer/floating point number and stores it in a file (Format operator).. 7#. Receive the filename from the user, open the file (say firstFile) and perform the following: a) Count the sentences in the text. b) Count the words in the text. c) Count the syllables in the text.. 24. AMU. LAB MANUAL/B.Sc. (CA)/CCB–2P1/CSD-AMU/JAN2020. CSD. AMU. d) Create a new file (secondFile) and copy the text from first file..

(26) OBJECTIVE S.  To learn how to create a linked list and perform different. OUTCOME S. WEEK #10. After completing this, the students would be able to understand. operations on it using pointer concepts (continues…).. .. and implement linked list and perform its different operations using pointer concepts (continues...).. PROBLEMS. S 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. 25. AMU. LAB MANUAL/B.Sc. (CA)/CCB–2P1/CSD-AMU/JAN2020. CSD. AMU. c. Deleting nodes from the list.

(27) OUTCOMES. OBJECTIVE S. WEEK #11 . To learn how to create Stack and perform its different operations.. .. After completing this, the students would be able to understand and implement Stack and perform its different operations. .. PROBLEMS. S. 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. 26. AMU. LAB MANUAL/B.Sc. (CA)/CCB–2P1/CSD-AMU/JAN2020. CSD. AMU. facing the left direction and other three stacks are facing in the right direction..

(28) OUTCOME S. OBJECTIVE S. WEEK #12 . To learn some of the applications of Stack.. After completing this, the students would be able to understand the practical usage of Stack with the help of implementing its some applications.. PROBLEMS. S 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. 27. AMU. LAB MANUAL/B.Sc. (CA)/CCB–2P1/CSD-AMU/JAN2020. CSD. AMU. stack..

(29) OUTCOMES. OBJECTIVE S. WEEK #13 . To learn how to create Queue and perform its different operations.. After completing this, the students would be able to understand and implement Queue and perform its different operations.. PROBLEMS. S 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. LAB MANUAL/B.Sc. (CA)/CCB–2P1/CSD-AMU/JAN2020. 28. AMU. Write a C program to move all the items from a queue onto stack.. CSD. AMU. 2#.

(30) OUTCOME S. OBJECTIVE S. WEEK #14 – 15 . To learn the concept of Binary tree, Binary Search Tree and their different functions.. After completing this, the students would be able to understand and implement Binary tree, Binary Search Tree and their different functions.. PROBLEMS. S 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.. 3#. Write a C program for Binary Search Tree to implement following operations: a. Insertion b. Finding an element c. Finding Min element. 29. AMU. LAB MANUAL/B.Sc. (CA)/CCB–2P1/CSD-AMU/JAN2020. CSD. AMU. d. Finding Max element..

(31) OUTCOME OBJECTIVE S S. WEEK #16 . To learn the concepts of Graph and their different functions.. After completing this, the students would be able to understand and implement Graph and their different functions.. PROBLEMS 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/B.Sc. (CA)/CCB–2P1/CSD-AMU/JAN2020. 30. AMU. 1#. CSD. AMU. S.

(32)

References

Related documents

a) Students will be able to define public administration and list its nature and scope. b) Students will be able to differentiate between public and private administration. c)

COURSE OUTCOMES: After successfully completing the course students shall be able to:..  Have the basic knowledge of the structure and properties of

COURSE OUTCOMES: After successfully completing the course students shall be able to:..  Develop an understanding of language, its description

LEARNING OUTCOMES: After successfully completing the course students shall be able to:..  Comprehend the basic concepts of form

LEARNING OUTCOMES: After successfully completing the course students shall be able to:..  Comprehend the basic concepts of form

Upon successful completion of this course, it is expected that students will be able to Understand, interpret and draw civil engineering construction drawings1. Topics Covered

Course Objectives: To introduce the basic and advanced concepts of Operations Research Course outcomes: On successful completion of this course, the students will be able to. 

COURSE OUTCOMES: After successfully completing the course students shall be able to:..  Develop an understanding of language, its description