LAB MANUAL - Prof. Anand Gharu

3y ago
118 Views
21 Downloads
1.98 MB
45 Pages
Last View : 2d ago
Last Download : 3m ago
Upload by : Mika Lloyd
Transcription

Pune Vidyarthi Griha’sCOLLEGE OF ENGINEERING, NASIKSE COMPUTER ENGINEERING DEPT.LAB MANUALDATA STRUCTURELABORATORYPrepared byPROF. ANAND GHARU2020 - 21

Data Structure and Lab (DSL)SE Computer EngineeringPune Vidyarthi Griha’sCOLLEGE OF ENGINEERING, NASHIK-4DEPARTMENT OF COMPUTER ENGINEERINGLab ManualSecond Year EngineeringSemester-IIIDATA STRUCTURES LABSubject Code: 210246Class: Second YearPrepared By:Prof. Anand N. Gharu(Assistant Professor, M.tech Computer Engineering)Academic year 2020-21Pune Vidyarthi Griha’s College of Engineering, nashik.Prof. Anand N. Gharu

Data Structure and Lab (DSL)SE Computer EngineeringDATA STRUCTURES LAB( 210246 )Teaching SchemeCreditPR: 04 Hours/Week02Examination SchemeTW: 25 MarksPR: 50 MarksGuidelines for Instructor's ManualThe instructor„s manual is to be developed as a hands-on resource and reference. The instructor'smanual need to include prologue (about University/program/ institute/ department/foreword/preface etc), University syllabus, conduction & Assessment guidelines, topics under considerationconcept, objectives, outcomes, set of typical applications/practicals/ guidelines, and references.Guidelines for Student JournalThe laboratory practicals are to be submitted by student in the form of journal. Journal consists ofprologue, Certificate, table of contents, and handwritten write-up of each practical (Title,Objectives, Problem Statement, Outcomes, software & Hardware requirements, Date ofCompletion, Assessment grade/marks and assessor's sign, Theory- Concept in brief, algorithm,flowchart, test cases, conclusion/analysis. Program codes with sample output of all performpractical‟s are to be submitted as softcopy.As a conscious effort and little contribution towards Green IT and environment awareness,attaching printed papers as part of write-ups and program listing to journal may be avoided. Use ofDVD containing students programs maintained by lab In-charge is highly encouraged. For referenceone or two journals may be maintained with program prints at Laboratory.Guidelines for AssessmentContinuous assessment of laboratory work is done based on overall performance and lab practicalsperformance of student. Each lab practical assessment will assign grade/marks based on parameterswith appropriate weightage. Suggested parameters for overall assessment as well as each labpractical assessment include- timely completion, performance, innovation, efficient codes,punctuality and neatness.Guidelines for Practical ExaminationBoth internal and external examiners should jointly set problem statements. During practicalassessment, the expert evaluator should give the maximum weightage to the satisfactoryimplementation of the problem statement. The supplementary and relevant questions may be askedat the time of evaluation to test the student„s for advanced learning, understanding of thefundamentals, effective and efficient implementation. So encouraging efforts, transparent evaluationand fair approach of the evaluator will not create any uncertainty or doubt in the minds of thestudents. So adhering to these principles will consummate our team efforts to the promising start ofthe student's academics.Guidelines for Laboratory ConductionThe instructor is expected to frame the practicals by understanding the prerequisites, technologicalaspects, utility and recent trends related to the topic. The practical framing policy need to addressthe average students and inclusive of an element to attract and promote the intelligent students. Theinstructor may set multiple sets of practicals and distribute among batches of students. It isappreciated if the practicals are based on real world problems/applications. Encourage students forPune Vidyarthi Griha’s College of Engineering, nashik.Prof. Anand N. Gharu

Data Structure and Lab (DSL)SE Computer Engineeringappropriate use of Hungarian notation, proper indentation and comments. Use of open sourcesoftware is to be encouraged.In addition to these, instructor may assign one real life application in the form of a mini- projectbased on the concepts learned. Instructor may also set one practical or mini-project that is suitableto respective branch beyond the scope of syllabus.Set of suggested practical list is provided in groups- A, B, C, D, and E. Each student must performat least 13 practicals as at least 3 from group A, 3 from group B, 2 from group C, 2 from group Dand 3 from group E.Group A and B assignments should be implemented in Python without using built-in methods formajor functionality of assignment. Use List data structure of Python as array. Group C, D and Eassignments should be implemented in C language.Operating System recommended:- 64-bit Open source Linux or its derivativeProgramming tools recommended: - Open Source Python,ProgrammingtoollikeJupyterNotebook,Pune Vidyarthi Griha’s College of Engineering, nashik.Pycharm,Spyder,G /GCC.Prof. Anand N. Gharu

Data Structure and Lab (DSL)racticalNo.SE Computer EngineeringLaboratory AssignmentsGROUP - A1234A-2 Write a Python program to store marks scored in subject “Fundamental ofData Structure” by N students in the class. Write functions to computefollowing:a) The average score of classb) Highest score and lowest score of classc) Count of students who were absent for the testd) Display mark with highest frequencyA-5 Write a Python program to compute following operations on String:a) To display word with the longest lengthb) To determines the frequency of occurrence of particular character in thestringc) To check given string is palindrome or notd) To display index of first substringe) To count the occurrences of each word in stringA-8 Write a Python program that determines the location of a saddle point ofmatrix if one exists. An m x n matrix is said to have a saddle point if someentry a[i][j] is the smallest value in row i & the largest value in j.A-9 Write a Python program to compute following computation on matrix:a)Addition of two matricesb) Subtraction of two matricesc) Multiplication of two matricesd) Transpose of a matrixGROUP - B567B-14 Write a Python program to store first year percentage of students in array.Write function for sorting array of floating point numbers in ascending order usinga)SelectionSortb) Bubble sort and display top five scores.B-15 Write a Python program to store second year percentage of students inarray. Write function for sorting array of floating point numbers in ascendingorder usinga) Insertion sortb) Shell Sort and display top five scoresB-16 Write a Python program to store first year percentage of students inarray. Write function for sorting array of floating point numbers in ascendingorder using quick sort and display top five scores.GROUP - C8C-19 Department of Computer Engineering has student's club named 'PinnacleClub'. Students of second, third and final year of department can be grantedmembership on request. Similarly one may cancel the membership of club.First node is reserved for president of club and last node is reserved forPune Vidyarthi Griha’s College of Engineering, nashik.Prof. Anand N. Gharu

Data Structure and Lab (DSL)SE Computer Engineeringsecretary of club. Write C program to maintain club member„s informationusing singly linked list. Store student PRN and Name. Write functions to:a) Add and delete the members as well as president or even secretary.b) Compute total number of members of clubc) Display membersd) Two linked lists exists for two divisions. Concatenate two lists.910C-20 The ticket booking system of Cinemax theater has to be implementedusing C program. There are 10 rows and 7 seats in each row. Doublycircular linked list has to be maintained to keep track of free seats at rows.Assume some random booking to start with. Use array to store pointers (Headpointer) to each row. On demanda) The list of available seats is to be displayedb) The seats are to be bookedc) The booking can be cancelled.C-21 Write C program for storing appointment schedule for day.Appointments are booked randomly using linked list. Set start and end timeand min and max duration for visit slot. Write functions forA) Display free slotsB) Book appointmentC) Sort list based on timeD) Cancel appointment ( check validity, time bounds, availability)E) Sort list based on time using pointer manipulationGROUP - D1112D-26 In any language program mostly syntax error occurs due to unbalancingdelimiter such as (),{},[]. Write C program using stack to check whethergiven expression is well parenthesized or not.D-27 Implement C program for expression conversion as infix to postfixand its evaluation using stack based on given conditions:1. Operands and operator, both must be single character.2. Input Postfix expression must be in a desired format.3. Only ' ', '-', '*' and '/ ' operators are expected.GROUP - E131415E-29 Queues are frequently used in computer programming, and a typicalexample is the creation of a job queue by an operating system. If the operatingsystem does not use priorities, then the jobs are processed in the order they enterthe system. Write C program for simulating job queue. Write functions to addjob and delete job from queue.E-31 A double-ended queue (deque) is a linear list in which additions anddeletions may be made at either end. Obtain a data representation mapping adeque into a one-dimensional array. Write C program to simulate deque withfunctions to add and delete elements from either end of the deque.E-32 Pizza parlor accepting maximum M orders. Orders are served in first comefirst served basis. Order once placed cannot be cancelled. Write C program tosimulate the system using circular queue using array.Pune Vidyarthi Griha’s College of Engineering, nashik.Prof. Anand N. Gharu

Data Structure and Lab (DSL)SE Computer EngineeringPractical No: 01(A)Practical Title: Write a python program to store marks for N students.Aim: - Write a Python program to store marks scored in subject “Fundamental of Data Structure” byN students in the class. Write functions to compute following:a) The average score of classb) Highest score and lowest score of classc) Count of students who were absent for the testd) Display mark with highest frequencyPrerequisite: Python ProgrammingObjectives:To understand the use functions for N students record.Input: N number of students.Outcome: Resulting average, highest and lowest marks operation.Theory:ARRAYSArrays a kind of data structure that can store a fixed-size sequential collection of elements of thesame type. An array is used to store a collection of data, but it is often more useful to think of anarray as a collection of variables of the same type.Instead of declaring individual variables, such as number0, number1, ., and number99, you declareone array variable such as numbers and use numbers[0], numbers[1], and ., numbers[99] torepresent individual variables. A specific element in an array is accessed by an index.All arrays consist of contiguous memory locations. The lowest address corresponds to the firstelement and the highest address to the last element.Declaring ArraysTo declare an array in C, a programmer specifies the type of the elements and the number of elementsrequired by an array as follows type arrayName [ arraySize ];This is called a single-dimensional array. The arraySize must be an integer constant greater than zeroand type can be any valid C data type. For example, to declare a 10-element array called balance oftype double, use this statement double balance[10];Pune Vidyarthi Griha’s College of Engineering, nashik.Prof. Anand N. Gharu

Data Structure and Lab (DSL)SE Computer EngineeringHere balance is a variable array which is sufficient to hold up to 10 double numbers.Initializing ArraysYou can initialize an array in C either one by one or using a single statement as follows double balance[5] {1000.0, 2.0, 3.4, 7.0, 50.0};Accessing Array ElementsAn element is accessed by indexing the array name. This is done by placing the index of the elementwithin square brackets after the name of the array. For example double salary balance[9];Functions Used :Write algorithm/pseudo code for each function.a) The average score of classb) Highest score and lowest score of classc) Count of students who were absent for the testd) Display mark with highest frequencyAlgorithm:WRITE ALGO.Flowchart :Here, draw flowchart of above algorithm.Conclusion:By this way, we can store the marks of N students sucessfully.APJ343TotalDated Sign10Questions:1. Basics of python Programming.2. What are functions?3. What are the features of python Programming?4. What are array?Pune Vidyarthi Griha’s College of Engineering, nashik.Prof. Anand N. Gharu

Data Structure and Lab (DSL)SE Computer EngineeringPractical No : 2(A)Practical Title: Write a python program to perform String operations.Aim: Write a Python program to compute following operations on String:a) To display word with the longest lengthb) To determines the frequency of occurrence of particular character in the stringc) To check whether given string is palindrome or notd) To display index of first appearance of the substringe) To count the occurrences of each word in a given stringPre-requisite: Basics of String operations.Objectives:To understand the use standard library functions for stirng opeations.To perform the string operations.Input: One or Two StringsOutput: Resulting string after performing string operation.Theory :String:String is defined as an array of characters or a pointer to characters.Null-terminated String:String is terminated by a special character which is called as null terminator or nullparameter (\0). So when you define a string you should be sure to have sufficient space forthe null terminator. The null terminator has value 0.Declaring String:As in string definition, we have two ways to declare a string. The first way is, wedeclare an array of characters as follows:char s[] “string”orchar str[20];String operation (explain each operation in detail with example)a) To display word with the longest lengthb) To determines the frequency of occurrence of particular character in the stringc) To check whether given string is palindrome or notd) To display index of first appearance of the substringe) To count the occurrences of each word in a given stringPune Vidyarthi Griha’s College of Engineering, nashik.Prof. Anand N. Gharu

Data Structure and Lab (DSL)SE Computer EngineeringAlgorithms :Write algorithms for your programFlowchart :Draw flowchart for above algorithmConclusion:By this way, we can perform string operations successfully.APJ343TotalDated Sign10Questions:1. Write a program to find the length of string.2. Write a program to display string from backward.3. Write a program to count number of words in string.4. Write a program to concatenate one string contents to another.5. Write a program to compare two strings they are exact equal or not.6. Write a program to check a string is palindrome or not.7. WAP to find a substring within a string. If found display its starting position.8. Write a program to reverse a string.9. Write a program to convert a string in lowercase.10. Write a program to convert a string in uppercase.Pune Vidyarthi Griha’s College of Engineering, nashik.Prof. Anand N. Gharu

Data Structure and Lab (DSL)SE Computer EngineeringPractical No : 03(A)Practical Title: Write program to determine saddle point of matrix.Aim : Write a Python program that determines the location of a saddle point of matrix if oneexists. An m x n matrix is said to have a saddle point if some entry a[i][j] is the smallest value in rowi and the largest value in j.Pre-requisite: Knowledge of representing matrix in Python Knowledge of different operations that can be performed on matrixObjectives:To understand the concept of saddle point in matrixTo implement python program for saddle pointInput :N x N Matrix to be providedOutcome:the location of a saddle point of matrixTheory:Concept of saddle point in matrix with example.Algorithms :Write algorithm for your programFlowchart :Draw flowchart for above algorithmConclusion:By this way, we can determine location of saddle point in matrix successfully.APJ343Pune Vidyarthi Griha’s College of Engineering, nashik.TotalDated Sign10Prof. Anand N. Gharu

Data Structure and Lab (DSL)SE Computer EngineeringPractical No: 4(A)Practical Title: Perform different operations on Matrix.Aim : Write a Python program to compute following computation on matrix:a) Addition of two matricesb) Subtraction of two matricesc) Multiplication of two matricesd) Transpose of a matrixPre-requisite: Knowledge of representing matrix in Python Knowledge of different operations that can be performed on matrixObjectives: Compute the transpose of matrix Perform addition , subtraction and multiplication of two matrices. Number of rows and columns of two matrices Elements of both the matrices Transpose of a matrix Result of addition , subtraction and multiplication of both matrices.Input:Outcome:Theory: 2-dimension array –write theory of 2-D array -MatrixOperations (explain each operation in detail with example)Concept of ose of matrixPune Vidyarthi Griha’s College of Engineering, nashik.Prof. Anand N. Gharu

Data Structure and Lab (DSL)SE Computer EngineeringAlgorithm:1. Start2. Input number of rows and columns of first matrix.3. Input elements of first matrix.4. Input number of rows and columns of second matrix.5. Input elements of Second matrix.6. Function to transpose first matrix i.e. the element at row r column c in the original is placed atrow c column r of the transpose.7. Fuction to add, subtract and multiply two matrices.Flowchart :Draw flowchart for above algorithmConclusion:By this way, we can perform various operations on matrix successfully.APJ343TotalDated Sign10Questions:2. What is upper triangular matrix and lower triangular matrix?3. How to find transpose of a matrix.4. Different operations on matrix.Pune Vidyarthi Griha’s College of Engineering, nashik.Prof. Anand N. Gharu

GROUP - BGROUP - B

Data Structure and Lab (DSL)SE Computer EngineeringPractical No:05(B)Practical Title: Sorting of an array using selection and bubble sort.Aim: Write a Python program to store first year percentage of students in array. Write function forsorting array of floating point numbers in ascending orderusinga)Selection Sortb) Bubble sort and display top five scores.of club.Pre-requisite:Knowledge of sorting techniquesObjective:To sort array of floating point numbers in ascending order usinga) Selection Sort b) Bubble sort and display top five scores.Input:Size of array Elements of arrayTheory :- Write short theory of sorting with its advantages and disadvantages.- Explain selection and bubble sort with exampleAlgorithm:def bubbleSort(alist):for passnum in range(len(alist)-1,0,-1):for i in range(passnum):if alist[i] alist[i 1]:temp alist[i]alist[i] alist[i 1]alist[i 1] tempalist (alist)def selectionSort(alist):for fillslot in range(len(alist)-1,0,-1):positionOfMax 0for location in range(1,fillslot 1):Pune Vidyarthi Griha’s College of Engineering, nashik.Prof. Anand N. Gharu

Data Structure and Lab (DSL)SE Computer Engineeringif alist[location] alist[positionOfMax]:positionOfMax locationtemp alist[fillslot]alist[fillslot] alist[positionOfMax]alist[positionOfMax] tempalist int(alist)Flowchart :Draw flowchart for above algorithms.Conclusion:By this way, we can perform sorting of an array using selection and bubble sort.APJ343TotalDated Sign10Question Bank:1. Explain the sorting?2. What are the different types of sorts in data structures3.Define the bubble sort?4. Define the selection sort?5. How many passes are required in selection sort?6. What is the time complexity of selecion and bubble sort?Pune Vidyarthi Griha’s C

Completion, Assessment grade/marks and assessor's sign, Theory- Concept in brief, algorithm, flowchart, test cases, conclusion/analysis. Program codes with sample output of all perform . To check given string is palindrome or not d) To display index of first substring e) To count the occurrences of each word in string 3 A-8 Write a Python .

Related Documents:

Prof. Hassan Soliman Prof. Hisham Abou Grida Prof. Hossam El Wakil Prof. Hossam Tawfik Prof. Ihab Nabil Prof. Mohamed El-Heneidy Prof. Mosaad Soliman Prof. Omar El Kasheif Prof. Sameh Zarad Prof. Sherif Moamen Prof. Tarek Radwan Prof. Usama El Nahas Prof. Wassila Taha Alphabetical Organizin

Web Technologies TE Computer Engineering Pune Vidyarthi Griha's College of Engineering, Nashik.

Dr. Intekhab Ahmed Prof. Bahram H. Arjmandi Prof. David A. Arnall Dr. Vivek Bhalla Prof. Bertrand Cariou Prof. Dmitry A. Chistyakov Prof. Fernando Cordido Prof. Franco Battista Ennio Folli Prof. Paul Albert Fournier Dr. Bruce H. Francis Dr. Xianxin Hua Prof. Joaquin Lado-Abeal Dr. Hongyun Lu Dr. Abbas A

Amrita Vidyalayam, Pushp Vihar, Sector 7, New Delhi IX 69 Dev Anand 10 Mrs. Madhu Bala Mr. Sanjeev Anand Manava Bharti India International School 6th 70 Yuvraj Anand 13 Mrs. Madhu Bala Mr. Sanjeev Anand Manava Bharati India International School, Panchsheel Park, New

By Dr. Anand Gupta By Dr Anand Gupta Mr. Mahesh Kapil 09356511518 09888711209 anandu71@yahoo.com mkapil_foru@yahoo.com

that anand has taken literature absolutely serious. It is vehicle for him to put across to his readers. His faith is comprehensive humanistic philosophy, as Dr. Balarma Gupta says: “Anand’s fictional as well as strong undercurrent of a broad-based philosophy of humanism. Anand frankly writes about the poor, the

44 Agarwal Nisha Rahul Year of PG MD PSM 09 45 Agarwal Parmanand Year of PG 2012 46 Agarwal Prakashchand G Year of UG 1998 47 Agarwal Rahul NA NA 48 Agarwal Rajesh Year of UG 1997 . 139 Anand Gulvadi Aparna NA NA 140 Anand Mohan Year of UG 2007 141 Anand R NA NA . 142 Anand Shubham Ranjan Year of UG MBBS 2006

The themes of pilgrimage and welcome are central to The Canterbury Journey. A lasting part of its legacy will be the new free-to-enter Welcome Centre with dedicated community and exhibition spaces and viewing gallery. The journey to our new centre is underway, to open in 2019. A New Welcome In 2017, the face of the Cathedral has changed .