Lab Manual. Data Structures (Pr): COT-213 Data Structures (P): IT-215
|
|
|
- Rosaline Antonia Floyd
- 9 years ago
- Views:
Transcription
1 Lab Manual Data Structures (Pr): COT-213 Data Structures (P): IT-215
2 !" #$%&'() * +, / * : ;7< <1= = <343> <>736=61694>309= ? ?@543= =1?730>A B ;0137<410351< '3!C96D68796D%!C69E!" F134=751=7G1/*713437<H734>F945751=7G1/F101=597H@@ B I=945*537<3@01F94571 )39JKL!!"?43>/ >?43> >M <<59737<60520= =1F53=37<I1137< = N303597?63O7249@016M =37<G >1 P3Q96R!8!" *71<*5M< = =37<G <05290>796303<<597 = G <071<309= M7N1497=97= A=92> @0>*71<*5/ =4=03437<<9@0>071<0513<1479< << <9@0>071< =35979<9@0>071<05M<>736= M79<154= =359737<<1309= O1<0537<41=4N =92>737<= S3T8U6!8!" 411H3==97=12537<< <@734>541137<39=351< >H734> N143051=7G1H734> @734> @734>5411H734>F134=411V13237< <1<@734>5411W432/ X <514543N1430B766=95F YZZ[\ ^1V949`5O37<F1F37/;7< F54=5417F1=97<<597a7N V><143@3<1-1X1H1+3510/ F54= @014-bb^1 c1x1*141/0353f54=541a v1,101;175/ d90^3493+@0=3597^efg1 g1h>497f1w9541<ah3@43/194>37<+49@ `5*3731f=36 F141BV-bbg
3 !" #$%"&'"&$!$("!)*!)+,- / /3 4$5*6$4$!"'$!$7$)78"!$)'$*&97'!6:556&!"76!!6$75!$! $'!55!$!9;6$78*5!&$!"8'$(7'$56"!!$7'!)'$$8*6$7 '$!5<5!!75!&6&&!"6!$7'!$'$7'$!5=<5!!>?"!5"!$5'!$( @2/A1/14052/A87@/2B689 C8668!")$&$&8$&!5$!)D*&$7E<$!$7!6)$6D*!!5F!7$)$6D*"6$7F*99"74$7G)$7H*6:$!5I!5J$ K- 42LMN %!!J&!$658$8!!7'$!$8!!$!)7!55&!'')8*6$7!66 $!9"&$58$!)8!!7'!!!7&!'*"!$$!'7!55$&*"$'"6!$8'! &!$67J!&'"8!''"6!$8$!6:7J'O!"*!$7&!P)'9"&7D*$!"!"6!$ 8$!6:!5D**>&*"$'"$!6:!5D**+ Q- R2/S :5$>58$7!"6!$8$!6:!5D**+CJ!&'"8":5"$7'"&!"!55$7 6&'!8D*$!"!5":5!"6!$8$!)>O766!$!$T6')8$"$+ U*9":5$U8$866*"!!55*9"":5"$7!557$!55"$7 '!&!$J7'$!$*)5*9"":5"$+CJ!&'"8!''"6!$85*9"":5"$> 5!&6$!)&!!)&$>5$*6$*7*$8!"6!$!55!"6!$7)!"P5"$!56*O!")$&86')!56&'!8"$+ - V1W1/ F!666'$!558$8!$!59!$!5!6!$5$&")7J!&'"8 $$*6$*+F!$$!O!"7F!$'$!$8$7$!8&!$8$$ 9!$7&&'!$9!$+X!'I'$!$8)!'!5$ $!O!"+ YZZ[4 +C]^$P!5+!?*5!&$!"8U!$!$*6$*7X!")$!7 =+I+F+`!$"CJ'$U!$!$*6$*(7a!!`*9"7=+ b+i++a*u!$!$*6$*t`)!&u)(7`]4+ +U+?+a *$!$8(&'*$`)!&&)c"7#!!`*9"6!$7_de+ -F+X$85!5`9"&8`)!&&)^$(!)*!)76!*&7G]7 d+
4 Lab Instructions Several practicals / programs? Whether an experiment contains one or several practicals /programs One practical / program Lab Teacher forms groups of the students based on All Students need to perform the practical/program Assign all practicals /programs among all groups Teacher decides whether the completed practicals / programs can be appropriately described using flow chart, algorithm, query statement, etc. Teacher issues necessary instructions to the students for writing practicals / programs accordingly Students write experiments in practical files and get them signed by the lab teacher Students make entries in the list of contents of the practical files and get them signed by the lab teacher Whether practical has been verified and signed by the lab teacher?? If a student has not completed a practical, he/she is expected to complete it at his/her own with the help of his/her fellow students in his/her hostel The student completes the practical file and submits it to the concerned teacher in his/her office or mail box on next working day In case of an experiment containing several practicals, a lab teacher needs to think whether a practical performed by the students in one group needs to be repeated by the other groups in lab on the same day? OR A practical performed by the students in one group needs to be repeated as assignments to be completed by the students of other groups in their hostels? Here, an assignment includes both executing a program on computer and also writing the same in practical file. OR A practical performed by the students in one group needs to be repeated as assignments, only writing practicals in their practical files, for the students of other groups in their hostels? Teacher issues necessary instructions to the students accordingly.
5 L T P Lab Manual Data Structures (P) COT-213 and IT-215 Practical exam: 40 Sessional: 60 Experiment 1 (Programs on Strings and Passing Pointers to Functions) I. Write a function that accepts as input a string and determines the frequency of occurences of each of the distinct characters in string. Test your function using suitable data. II. Write a function, strndel, that accepts a string and two integers, start and length. Return a new string that is equivalent to the original string, except that length characters beginning at start have been removed. III. Write a function, strdel, that accepts a string and a character. The function returns string with the first occurence of character removed. IV. WAP with function to swap two numbers using call by reference. V. WAP with function to swap two integer arrays of same size using call by reference. VI. WAP to reverse an array by swapping (without using additional memory). VII. WAP with function to swap two strings using pointers. VIII. WAP to find the number of Non Repeated elements in an Array. IX. WAP to identify the missing numbers in a given Array within the range [1...N]. Experiment 2 (Dynamic Memory Allocation and File Operations) I. WAP to find the Median of the elements after merging the two sorted Arrays of same size. II. WAP to store an information in array of structure, dynamically, and also give a function to display the current information. The program should give user a choice for inserting a data or to display the current data. Implement the program for Student structures (contains student_name, student_roll_no, total_marks). III. Implement the above program for Employee structures (contains employee_name, emp_no, emp_salary). IV. Implement the above program for Faculty structures (contains faculty_name, faculty_id, subject_codes, class_names). V. WAP to Create a new file, Open an existing file, read the file to search a given word, write into the file and close the file. 1
6 Experiment 3 (Searching and Sorting in Non-decreasing order) Test the following programs on various cases such as already sorted, reverse sorted and average sorted cases. Also verify whether the sorting algorithm is stable. Count the number of swaps and number of comparisons taken place. I. WAP to implement Linear search and Binary search on 1D array of Integers. II. WAP to implement Insertion and Selection sort on 1D array of strings. III. WAP to implement Quick sort on 1D array of characters. IV. WAP to implement Merge Sort on 1D array of Student structures (contains student_name, student_roll_no, total_marks) with key as student_roll_no. V. WAP to implement Bubble and Radix sort on 1D array of Faculty structures (contains faculty_name, faculty_id, subject_codes, class_names) with key as faculty_id. Experiment 4 (Sparse Arrays and Matrix Operations) I. WAP to store and display a Lower-Right triangular matrix in RMO and CMO fashion. II. WAP to store and display an Upper-Right triangular matrix in RMO and CMO fashion. III. WAP to store and display a Tri-Diagonal matirx in RMO and CMO fashion. IV. WAP to store and display a Lower-Left triangular matrix in RMO and CMO fashion. V. WAP to store and display an Upper-Left triangular matrix in RMO and CMO fashion. VI. WAP to store and display a C matrix in RMO and CMO fashion. (C matrix contains non-zero elements in first row, last row and first column only) VII. WAP to store and display a Z matrix in RMO and CMO fashion. (Z matrix contains nonzero elements in first row, last row and right diagonal only.) VIII. WAP using switch statement to perform the following functions: Transpose of a matrix, computing determinant of a matirx, addition of two matrices and multiplication of two matrices. The program should handle a wrong input exceptions such as size mis-match, etc. IX. WAP for addition and multiplication of two sparse matrices. The matrices can be any of the following type, a. Lower-Right triangularmatrix b. Upper-Right triangular matrix c. Tri-Diagonal matrix d. Lower-Left triangular matrix e. Upper-Left triangular matrix Firstly the program should ask the user about the type(s) of input matrices, store the given matrices either in RMO or CMO fashion in 1D Array and then perform the respective operation and display the result. 2
7 Experiment 5 (Stacks and Queues) I. (a) WAP to implement Stack ADT using Arrays which has basic operations as Create(), IsEmpty(), Push(), Pop(), IsFull() with appropriate prototype to a functions. WAP to evaluate a given postfix expression using stack ADT. II. (a) (c) III. IV. WAP to Cyclically Permute the elements of an Array. WAP to check the given string is palindrome using stack. WAP to check the given expression is correctly parenthesized. WAP to Implement two overlapping Stacks, facing in opposite directions, using an Array and Check for Overflow & Underflow conditions. WAP to implement a 3-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), m n/3. Stacks are not overlapping each other. Leftmost stack facing the left direction and other two stacks are facing in the right direction. V. (a) WAP to transform infix expression into equivalent postfix expression using stack. Also use the user defined operators, $,#, etc, with appropiate priorities. Eg. A+(B*C- D/E$F)*G)*H, {*,/} > $ > {+,-} WAP to tranform infix expression into equivalent prefix expression, similar as above. VI.(a) VII.(a) WAP wihch gives the solution to the Tower of Hanoi problem for n disks. Test the program using: a) N=3, b) N=4. WAP to solve Maze problem of size mxn. WAP to implement Queue ADT using Arrays with the basic functions of Create(), IsEmpty(), Insert(), Delete() and IsFull() with suitable prototype to a functions. WAP to implement Queue using Stacks. VIII.(a) WAP to implement 2 overlapping queues in an Array of size N. There are facing in opposite direction to eachother. Give IsEmpty(i), Insert(i), Delete(i) and IsFull(i) routines for i th queue. WAP to implement Dequeue using Arrays with all the basic operations. 3
8 Experiment 6 (Singly Linked List) I. WAP to construct simple linear linked list using dynamic memory allocation for the given elements with the following functions, (a) Inserting a new node, Accessing a node (finding the position wrt header), (c) Removing a node with particular key value, (d) Complete deletion of a linked list, and (e) Displaying the current list. (f) Copy the linked list and return the pointer of the new list. Implement the above program for the elements as Strings. II. (a) III. (a) IV. (a) WAP to reverse a singly linked list using one auxillary pointer. And try without using any auxillary pointer. WAP to implement Stack ADT using Linked list with the basic operations as Create(), IsEmpty(), Push(), Pop(), IsFull() with appropriate prototype to a functions. WAP to implement Queue ADT using Linked list with the basic functions of Create(), IsEmpty(), Insert(), Delete() and IsFull() with suitable prototype to a functions. WAP to perform BFS on the given tree (represented in Linked list form) using Queue ADT. WAP for polynomial addition and multiplication. Represent polynomial in linked list form with suitable data structure. WAP to compare two polynomials. Represent polynomial in linked list form with suitable data structure. V. WAP to swap elements in pairs in the given linked list. (e.g.: 1->2->3->4->5->null, then result should be 2->1->4->3->5->null.) VI. (a) (c) WAP to find second last node of the given linked list. WAP to concatenate two singly linked list in sorted order either ascending or descending. WAP to sort singly linked list. VII. (a) WAP to print alternate nodes from the list. WAP to concatenate the even elements from the two linked list. (c) WAP to find first common element between two linked list. (d) WAP to find the number of occurrence of all the elements in a linked list. 4
9 Experiment 7 (Circular Singly Linked List and Doubly Linked List) I. WAP to create a Circular Singly Linked List for the given elements with the following functions, (a) Inserting a node, before the node with key givenkey, Inserting a node, after the node with key givenkey, (c) Accessing a node (finding the position wrt header), (d) Removing a node with particular key value, (e) Complete deletion of a list, (f) Displaying the current list, and (g) Sorting the list. Implement the above program for the elements as Strings. II. WAP to implement doubly linked list with the following operations; (a) Inserting a node, before the node with key givenkey, Inserting a node, after the node with key givenkey, (c) Inserting a node at i ith location wrt header.(assuming header at 1 st location) (d) Accessing a node (finding the position wrt header), (e) Removing a node with particular key value, (f) Complete deletion of a list, (g) Displaying the current list in clockwise fashion, (h) Displaying the current list in anti-clockwise fashion, and (i) Sorting the list. Implement the above program for the elements as Student structures (contains student_name, student_roll_no, total_marks) with key as student_roll_no. III. WAP to represent various sparse matrices using linked list and give addition function to add two sparse matrices. IV. Implement the above program (1) with the elements as Employee structures (contains employee_name, emp_no, emp_salary) with key as emp_no. V. Implement the above program (2) with the elements as Faculty structures (contains faculty_name, faculty_id, subject_codes, class_names) with key as faculty_id. Experiment 8 (Binary Trees, BST, Heaps, Heap sort and Threaded Binary Trees) I. (a) WAP to build a binary tree for the given elements (integers) and also give traversal functions : inorder, preorder, postorder. WAP to traverse a given binary tree in inorder, preorder, postorder, converse inorder, converse preorder, converse postorder fashion. (converse - traverse in a reverse direction) (c) WAP to transform given tree into a binary tree. (d) WAP to represent an arithematic expression in binary tree format. II.(a) WAP to implement BST with insertion, search and deletion operation for the elements as strings. WAP using function to find inorder-predecessor and inorder-successor for any node in 5
10 (c) III.(a) a BST. WAP using functions to find the height, number of levels, number of leave nodes, number of internal nodes and total number of nodes in the given BST. WAP to implement priority queues using heaps (min heap or max heap) with add and delete functions. WAP to perform heap sort on the given list of elements. Experiment 9 (Graphs) I. (a) WAP to represent the given graph in the form of adjacency list. II. (a) III. IV. WAP to find cut-set of the given graph. WAP to represent the given graph in the form of adjacency matrix. WAP to find cut-vertex of the given graph. WAP to perform BFS for any given graph. WAP to perform DFS for any given graph. Advanced Problems (Optional) I. WAP to implement Shell and Bucket sort on 1D array of Employee structures (contains employee_name, emp_no, emp_salary) with key as emp_no. II. WAP to find the middle element of the given linked list in one pass. (Hint: take 2 pointers p and q. Initially p will point to 1 st node and q will point to 2 nd node. Advance p always by 1 and q by 2. Proceed this way until q reached last node, so now p will point to the middle element. ) III. Write an efficient program to remove duplicates from a singly linked list. IV. WAP to convert BST into inorder Thereaded binary tree. V. WAP to convert BST into preorder Thereaded binary tree. VI. WAP to convert BST into postorder Thereaded binary tree. VII. WAP to find minimum cost spanning tree for the given tree using kruskal s method. VIII. WAP to find minimum cost spanning tree for the given tree using prims s method. 6
PES Institute of Technology-BSC QUESTION BANK
PES Institute of Technology-BSC Faculty: Mrs. R.Bharathi CS35: Data Structures Using C QUESTION BANK UNIT I -BASIC CONCEPTS 1. What is an ADT? Briefly explain the categories that classify the functions
10CS35: Data Structures Using C
CS35: Data Structures Using C QUESTION BANK REVIEW OF STRUCTURES AND POINTERS, INTRODUCTION TO SPECIAL FEATURES OF C OBJECTIVE: Learn : Usage of structures, unions - a conventional tool for handling a
DATA STRUCTURES USING C
DATA STRUCTURES USING C QUESTION BANK UNIT I 1. Define data. 2. Define Entity. 3. Define information. 4. Define Array. 5. Define data structure. 6. Give any two applications of data structures. 7. Give
1) The postfix expression for the infix expression A+B*(C+D)/F+D*E is ABCD+*F/DE*++
Answer the following 1) The postfix expression for the infix expression A+B*(C+D)/F+D*E is ABCD+*F/DE*++ 2) Which data structure is needed to convert infix notations to postfix notations? Stack 3) The
Data Structure [Question Bank]
Unit I (Analysis of Algorithms) 1. What are algorithms and how they are useful? 2. Describe the factor on best algorithms depends on? 3. Differentiate: Correct & Incorrect Algorithms? 4. Write short note:
Krishna Institute of Engineering & Technology, Ghaziabad Department of Computer Application MCA-213 : DATA STRUCTURES USING C
Tutorial#1 Q 1:- Explain the terms data, elementary item, entity, primary key, domain, attribute and information? Also give examples in support of your answer? Q 2:- What is a Data Type? Differentiate
GUJARAT TECHNOLOGICAL UNIVERSITY, AHMEDABAD, GUJARAT. Course Curriculum. DATA STRUCTURES (Code: 3330704)
GUJARAT TECHNOLOGICAL UNIVERSITY, AHMEDABAD, GUJARAT Course Curriculum DATA STRUCTURES (Code: 3330704) Diploma Programme in which this course is offered Semester in which offered Computer Engineering,
Data Structure and Algorithm I Midterm Examination 120 points Time: 9:10am-12:10pm (180 minutes), Friday, November 12, 2010
Data Structure and Algorithm I Midterm Examination 120 points Time: 9:10am-12:10pm (180 minutes), Friday, November 12, 2010 Problem 1. In each of the following question, please specify if the statement
Sample Questions Csci 1112 A. Bellaachia
Sample Questions Csci 1112 A. Bellaachia Important Series : o S( N) 1 2 N N i N(1 N) / 2 i 1 o Sum of squares: N 2 N( N 1)(2N 1) N i for large N i 1 6 o Sum of exponents: N k 1 k N i for large N and k
Exam study sheet for CS2711. List of topics
Exam study sheet for CS2711 Here is the list of topics you need to know for the final exam. For each data structure listed below, make sure you can do the following: 1. Give an example of this data structure
Unit 1. 5. Write iterative and recursive C functions to find the greatest common divisor of two integers. [6]
Unit 1 1. Write the following statements in C : [4] Print the address of a float variable P. Declare and initialize an array to four characters a,b,c,d. 2. Declare a pointer to a function f which accepts
Java Software Structures
INTERNATIONAL EDITION Java Software Structures Designing and Using Data Structures FOURTH EDITION John Lewis Joseph Chase This page is intentionally left blank. Java Software Structures,International Edition
5. A full binary tree with n leaves contains [A] n nodes. [B] log n 2 nodes. [C] 2n 1 nodes. [D] n 2 nodes.
1. The advantage of.. is that they solve the problem if sequential storage representation. But disadvantage in that is they are sequential lists. [A] Lists [B] Linked Lists [A] Trees [A] Queues 2. The
Binary Search Trees CMPSC 122
Binary Search Trees CMPSC 122 Note: This notes packet has significant overlap with the first set of trees notes I do in CMPSC 360, but goes into much greater depth on turning BSTs into pseudocode than
Data Structures. Level 6 C30151. www.fetac.ie. Module Descriptor
The Further Education and Training Awards Council (FETAC) was set up as a statutory body on 11 June 2001 by the Minister for Education and Science. Under the Qualifications (Education & Training) Act,
Analysis of a Search Algorithm
CSE 326 Lecture 4: Lists and Stacks 1. Agfgd 2. Dgsdsfd 3. Hdffdsf 4. Sdfgsfdg 5. Tefsdgass We will review: Analysis: Searching a sorted array (from last time) List ADT: Insert, Delete, Find, First, Kth,
Questions 1 through 25 are worth 2 points each. Choose one best answer for each.
Questions 1 through 25 are worth 2 points each. Choose one best answer for each. 1. For the singly linked list implementation of the queue, where are the enqueues and dequeues performed? c a. Enqueue in
1. The memory address of the first element of an array is called A. floor address B. foundation addressc. first address D.
1. The memory address of the first element of an array is called A. floor address B. foundation addressc. first address D. base address 2. The memory address of fifth element of an array can be calculated
CSE 326, Data Structures. Sample Final Exam. Problem Max Points Score 1 14 (2x7) 2 18 (3x6) 3 4 4 7 5 9 6 16 7 8 8 4 9 8 10 4 Total 92.
Name: Email ID: CSE 326, Data Structures Section: Sample Final Exam Instructions: The exam is closed book, closed notes. Unless otherwise stated, N denotes the number of elements in the data structure
Atmiya Infotech Pvt. Ltd. Data Structure. By Ajay Raiyani. Yogidham, Kalawad Road, Rajkot. Ph : 572365, 576681 1
Data Structure By Ajay Raiyani Yogidham, Kalawad Road, Rajkot. Ph : 572365, 576681 1 Linked List 4 Singly Linked List...4 Doubly Linked List...7 Explain Doubly Linked list: -...7 Circular Singly Linked
Lab Manual. Advanced Pr I IT 314
Lab Manual Advanced Pr I IT 314 Lab Instructions Several practicals / programs? Whether an experiment contains one or several practicals /programs One practical / program Lab Teacher forms groups of the
International Journal of Software and Web Sciences (IJSWS) www.iasir.net
International Association of Scientific Innovation and Research (IASIR) (An Association Unifying the Sciences, Engineering, and Applied Research) ISSN (Print): 2279-0063 ISSN (Online): 2279-0071 International
A TOOL FOR DATA STRUCTURE VISUALIZATION AND USER-DEFINED ALGORITHM ANIMATION
A TOOL FOR DATA STRUCTURE VISUALIZATION AND USER-DEFINED ALGORITHM ANIMATION Tao Chen 1, Tarek Sobh 2 Abstract -- In this paper, a software application that features the visualization of commonly used
BCS2B02: OOP Concepts and Data Structures Using C++
SECOND SEMESTER BCS2B02: OOP Concepts and Data Structures Using C++ Course Number: 10 Contact Hours per Week: 4 (2T + 2P) Number of Credits: 2 Number of Contact Hours: 30 Hrs. Course Evaluation: Internal
Ordered Lists and Binary Trees
Data Structures and Algorithms Ordered Lists and Binary Trees Chris Brooks Department of Computer Science University of San Francisco Department of Computer Science University of San Francisco p.1/62 6-0:
MAX = 5 Current = 0 'This will declare an array with 5 elements. Inserting a Value onto the Stack (Push) -----------------------------------------
=============================================================================================================================== DATA STRUCTURE PSEUDO-CODE EXAMPLES (c) Mubashir N. Mir - www.mubashirnabi.com
Objected oriented Programming: C++ Unit 1 1. Introduction 1.1. Introduction to Object Oriented Programming. 1.2. C++ fundamentals.
Gujarat University Choice Based Credit System (CBCS) Syllabus for B. Sc. Semester III (Computer Science) COM 201: DATA STRUCTURE USING C++ (Theory) Hours: 4 /week Credits: 4 Objected oriented Programming:
Bangalore University B.Sc Computer Science Syllabus ( Semester System)
Bangalore University B.Sc Computer Science Syllabus ( Semester System) First Semester CSIT1: Computer Fundamentals and C Programming CSIP1: C Programming Lab Second Semester CSIIT1: Data Structures and
Abstract Data Type. EECS 281: Data Structures and Algorithms. The Foundation: Data Structures and Abstract Data Types
EECS 281: Data Structures and Algorithms The Foundation: Data Structures and Abstract Data Types Computer science is the science of abstraction. Abstract Data Type Abstraction of a data structure on that
Binary Heap Algorithms
CS Data Structures and Algorithms Lecture Slides Wednesday, April 5, 2009 Glenn G. Chappell Department of Computer Science University of Alaska Fairbanks [email protected] 2005 2009 Glenn G. Chappell
Chapter 3: Restricted Structures Page 1
Chapter 3: Restricted Structures Page 1 1 2 3 4 5 6 7 8 9 10 Restricted Structures Chapter 3 Overview Of Restricted Structures The two most commonly used restricted structures are Stack and Queue Both
To My Parents -Laxmi and Modaiah. To My Family Members. To My Friends. To IIT Bombay. To All Hard Workers
To My Parents -Laxmi and Modaiah To My Family Members To My Friends To IIT Bombay To All Hard Workers Copyright 2010 by CareerMonk.com All rights reserved. Designed by Narasimha Karumanchi Printed in
Any two nodes which are connected by an edge in a graph are called adjacent node.
. iscuss following. Graph graph G consist of a non empty set V called the set of nodes (points, vertices) of the graph, a set which is the set of edges and a mapping from the set of edges to a set of pairs
Binary Search Trees. A Generic Tree. Binary Trees. Nodes in a binary search tree ( B-S-T) are of the form. P parent. Key. Satellite data L R
Binary Search Trees A Generic Tree Nodes in a binary search tree ( B-S-T) are of the form P parent Key A Satellite data L R B C D E F G H I J The B-S-T has a root node which is the only node whose parent
DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING LESSON PLAN
ERODE SENGUNTHAR ENGINEERING COLLEGE (Approved by AICTE, New Delhi, Permanently Affiliated to Anna University - Chennai & Accredited by NAAC & National Board of Accreditation (NBA), New Delhi, Accredited
AP Computer Science AB Syllabus 1
AP Computer Science AB Syllabus 1 Course Resources Java Software Solutions for AP Computer Science, J. Lewis, W. Loftus, and C. Cocking, First Edition, 2004, Prentice Hall. Video: Sorting Out Sorting,
University of Pune Revised Structure for the B. Sc. (Computer Science) Course (Second Year to be implemented from Academic Year 2014-2015)
University of Pune Revised Structure for the B. Sc. (Computer Science) Course (Second Year to be implemented from Academic Year 2014-2015) S. Y. B. Sc. (Computer Science) No Paper Title: Semester I Title:
Data Structures and Algorithms
Data Structures and Algorithms CS245-2016S-06 Binary Search Trees David Galles Department of Computer Science University of San Francisco 06-0: Ordered List ADT Operations: Insert an element in the list
Module 2 Stacks and Queues: Abstract Data Types
Module 2 Stacks and Queues: Abstract Data Types A stack is one of the most important and useful non-primitive linear data structure in computer science. It is an ordered collection of items into which
EE2204 DATA STRUCTURES AND ALGORITHM (Common to EEE, EIE & ICE)
EE2204 DATA STRUCTURES AND ALGORITHM (Common to EEE, EIE & ICE) UNIT I LINEAR STRUCTURES Abstract Data Types (ADT) List ADT array-based implementation linked list implementation cursor-based linked lists
Common Data Structures
Data Structures 1 Common Data Structures Arrays (single and multiple dimensional) Linked Lists Stacks Queues Trees Graphs You should already be familiar with arrays, so they will not be discussed. Trees
CHAPTER 4 ESSENTIAL DATA STRUCTRURES
CHAPTER 4 ESSENTIAL DATA STRUCTURES 72 CHAPTER 4 ESSENTIAL DATA STRUCTRURES In every algorithm, there is a need to store data. Ranging from storing a single value in a single variable, to more complex
Converting a Number from Decimal to Binary
Converting a Number from Decimal to Binary Convert nonnegative integer in decimal format (base 10) into equivalent binary number (base 2) Rightmost bit of x Remainder of x after division by two Recursive
Syllabus for Computer Science. Proposed scheme for B.Sc Programme under Choice Based Credit System
Syllabus for Computer Science Proposed scheme for B.Sc Programme under Choice Based Credit System SEMESTER - I Code Course Title Course Type HPW Credits BS106 SEMESTER -I I BS 206 SEMESTER -III BS 301
Dynamic Programming. Lecture 11. 11.1 Overview. 11.2 Introduction
Lecture 11 Dynamic Programming 11.1 Overview Dynamic Programming is a powerful technique that allows one to solve many different types of problems in time O(n 2 ) or O(n 3 ) for which a naive approach
The following themes form the major topics of this chapter: The terms and concepts related to trees (Section 5.2).
CHAPTER 5 The Tree Data Model There are many situations in which information has a hierarchical or nested structure like that found in family trees or organization charts. The abstraction that models hierarchical
St S a t ck a ck nd Qu Q eue 1
Stack and Queue 1 Stack Data structure with Last-In First-Out (LIFO) behavior In Out C B A B C 2 Typical Operations Pop on Stack Push isempty: determines if the stack has no elements isfull: determines
2. (a) Explain the strassen s matrix multiplication. (b) Write deletion algorithm, of Binary search tree. [8+8]
Code No: R05220502 Set No. 1 1. (a) Describe the performance analysis in detail. (b) Show that f 1 (n)+f 2 (n) = 0(max(g 1 (n), g 2 (n)) where f 1 (n) = 0(g 1 (n)) and f 2 (n) = 0(g 2 (n)). [8+8] 2. (a)
Data Structures and Data Manipulation
Data Structures and Data Manipulation What the Specification Says: Explain how static data structures may be used to implement dynamic data structures; Describe algorithms for the insertion, retrieval
Binary Search Trees (BST)
Binary Search Trees (BST) 1. Hierarchical data structure with a single reference to node 2. Each node has at most two child nodes (a left and a right child) 3. Nodes are organized by the Binary Search
ECE 250 Data Structures and Algorithms MIDTERM EXAMINATION 2008-10-23/5:15-6:45 REC-200, EVI-350, RCH-106, HH-139
ECE 250 Data Structures and Algorithms MIDTERM EXAMINATION 2008-10-23/5:15-6:45 REC-200, EVI-350, RCH-106, HH-139 Instructions: No aides. Turn off all electronic media and store them under your desk. If
Binary Heaps * * * * * * * / / \ / \ / \ / \ / \ * * * * * * * * * * * / / \ / \ / / \ / \ * * * * * * * * * *
Binary Heaps A binary heap is another data structure. It implements a priority queue. Priority Queue has the following operations: isempty add (with priority) remove (highest priority) peek (at highest
DATA STRUCTURE - QUEUE
DATA STRUCTURE - QUEUE http://www.tutorialspoint.com/data_structures_algorithms/dsa_queue.htm Copyright tutorialspoint.com Queue is an abstract data structure, somewhat similar to stack. In contrast to
Sorting Algorithms. Nelson Padua-Perez Bill Pugh. Department of Computer Science University of Maryland, College Park
Sorting Algorithms Nelson Padua-Perez Bill Pugh Department of Computer Science University of Maryland, College Park Overview Comparison sort Bubble sort Selection sort Tree sort Heap sort Quick sort Merge
CS104: Data Structures and Object-Oriented Design (Fall 2013) October 24, 2013: Priority Queues Scribes: CS 104 Teaching Team
CS104: Data Structures and Object-Oriented Design (Fall 2013) October 24, 2013: Priority Queues Scribes: CS 104 Teaching Team Lecture Summary In this lecture, we learned about the ADT Priority Queue. A
Data Structures UNIT III. Model Question Answer
Data Structures UNIT III Model Question Answer Q.1. Define Stack? What are the different primitive operations on Stack? Ans: Stack: A stack is a linear structure in which items may be added or removed
Data Structures. Topic #12
Data Structures Topic #12 Today s Agenda Sorting Algorithms insertion sort selection sort exchange sort shell sort radix sort As we learn about each sorting algorithm, we will discuss its efficiency Sorting
A binary search tree or BST is a binary tree that is either empty or in which the data element of each node has a key, and:
Binary Search Trees 1 The general binary tree shown in the previous chapter is not terribly useful in practice. The chief use of binary trees is for providing rapid access to data (indexing, if you will)
Data Structure with C
Subject: Data Structure with C Topic : Tree Tree A tree is a set of nodes that either:is empty or has a designated node, called the root, from which hierarchically descend zero or more subtrees, which
Lecture 11 Doubly Linked Lists & Array of Linked Lists. Doubly Linked Lists
Lecture 11 Doubly Linked Lists & Array of Linked Lists In this lecture Doubly linked lists Array of Linked Lists Creating an Array of Linked Lists Representing a Sparse Matrix Defining a Node for a Sparse
INTERNATIONAL JOURNAL OF PURE AND APPLIED RESEARCH IN ENGINEERING AND TECHNOLOGY
INTERNATIONAL JOURNAL OF PURE AND APPLIED RESEARCH IN ENGINEERING AND TECHNOLOGY A PATH FOR HORIZING YOUR INNOVATIVE WORK A REVIEW ON THE USAGE OF OLD AND NEW DATA STRUCTURE ARRAYS, LINKED LIST, STACK,
Data Structures Using C++ 2E. Chapter 5 Linked Lists
Data Structures Using C++ 2E Chapter 5 Linked Lists Doubly Linked Lists Traversed in either direction Typical operations Initialize the list Destroy the list Determine if list empty Search list for a given
CSE373: Data Structures and Algorithms Lecture 1: Introduction; ADTs; Stacks/Queues. Linda Shapiro Spring 2016
CSE373: Data Structures and Algorithms Lecture 1: Introduction; ADTs; Stacks/Queues Linda Shapiro Registration We have 180 students registered and others who want to get in. If you re thinking of dropping
TREE BASIC TERMINOLOGIES
TREE Trees are very flexible, versatile and powerful non-liner data structure that can be used to represent data items possessing hierarchical relationship between the grand father and his children and
Data Structures, Practice Homework 3, with Solutions (not to be handed in)
Data Structures, Practice Homework 3, with Solutions (not to be handed in) 1. Carrano, 4th edition, Chapter 9, Exercise 1: What is the order of each of the following tasks in the worst case? (a) Computing
7.1 Our Current Model
Chapter 7 The Stack In this chapter we examine what is arguably the most important abstract data type in computer science, the stack. We will see that the stack ADT and its implementation are very simple.
Home Page. Data Structures. Title Page. Page 1 of 24. Go Back. Full Screen. Close. Quit
Data Structures Page 1 of 24 A.1. Arrays (Vectors) n-element vector start address + ielementsize 0 +1 +2 +3 +4... +n-1 start address continuous memory block static, if size is known at compile time dynamic,
Introduction to Data Structures
Introduction to Data Structures Albert Gural October 28, 2011 1 Introduction When trying to convert from an algorithm to the actual code, one important aspect to consider is how to store and manipulate
ML for the Working Programmer
ML for the Working Programmer 2nd edition Lawrence C. Paulson University of Cambridge CAMBRIDGE UNIVERSITY PRESS CONTENTS Preface to the Second Edition Preface xiii xv 1 Standard ML 1 Functional Programming
Algorithms and Data Structures
Algorithms and Data Structures Part 2: Data Structures PD Dr. rer. nat. habil. Ralf-Peter Mundani Computation in Engineering (CiE) Summer Term 2016 Overview general linked lists stacks queues trees 2 2
PART-A Questions. 2. How does an enumerated statement differ from a typedef statement?
1. Distinguish & and && operators. PART-A Questions 2. How does an enumerated statement differ from a typedef statement? 3. What are the various members of a class? 4. Who can access the protected members
AP Computer Science Java Mr. Clausen Program 9A, 9B
AP Computer Science Java Mr. Clausen Program 9A, 9B PROGRAM 9A I m_sort_of_searching (20 points now, 60 points when all parts are finished) The purpose of this project is to set up a program that will
The Elective Part of the NSS ICT Curriculum D. Software Development
of the NSS ICT Curriculum D. Software Development Mr. CHEUNG Wah-sang / Mr. WONG Wing-hong, Robert Member of CDC HKEAA Committee on ICT (Senior Secondary) 1 D. Software Development The concepts / skills
Chapter 13: Query Processing. Basic Steps in Query Processing
Chapter 13: Query Processing! Overview! Measures of Query Cost! Selection Operation! Sorting! Join Operation! Other Operations! Evaluation of Expressions 13.1 Basic Steps in Query Processing 1. Parsing
root node level: internal node edge leaf node CS@VT Data Structures & Algorithms 2000-2009 McQuain
inary Trees 1 A binary tree is either empty, or it consists of a node called the root together with two binary trees called the left subtree and the right subtree of the root, which are disjoint from each
ALLIED PAPER : DISCRETE MATHEMATICS (for B.Sc. Computer Technology & B.Sc. Multimedia and Web Technology)
ALLIED PAPER : DISCRETE MATHEMATICS (for B.Sc. Computer Technology & B.Sc. Multimedia and Web Technology) Subject Description: This subject deals with discrete structures like set theory, mathematical
CompSci-61B, Data Structures Final Exam
Your Name: CompSci-61B, Data Structures Final Exam Your 8-digit Student ID: Your CS61B Class Account Login: This is a final test for mastery of the material covered in our labs, lectures, and readings.
1. Define: (a) Variable, (b) Constant, (c) Type, (d) Enumerated Type, (e) Identifier.
Study Group 1 Variables and Types 1. Define: (a) Variable, (b) Constant, (c) Type, (d) Enumerated Type, (e) Identifier. 2. What does the byte 00100110 represent? 3. What is the purpose of the declarations
Pseudo code Tutorial and Exercises Teacher s Version
Pseudo code Tutorial and Exercises Teacher s Version Pseudo-code is an informal way to express the design of a computer program or an algorithm in 1.45. The aim is to get the idea quickly and also easy
Heaps & Priority Queues in the C++ STL 2-3 Trees
Heaps & Priority Queues in the C++ STL 2-3 Trees CS 3 Data Structures and Algorithms Lecture Slides Friday, April 7, 2009 Glenn G. Chappell Department of Computer Science University of Alaska Fairbanks
Symbol Tables. Introduction
Symbol Tables Introduction A compiler needs to collect and use information about the names appearing in the source program. This information is entered into a data structure called a symbol table. The
Chapter 14 The Binary Search Tree
Chapter 14 The Binary Search Tree In Chapter 5 we discussed the binary search algorithm, which depends on a sorted vector. Although the binary search, being in O(lg(n)), is very efficient, inserting a
Algorithms and data structures
Algorithms and data structures This course will examine various data structures for storing and accessing information together with relationships between the items being stored, and algorithms for efficiently
I PUC - Computer Science. Practical s Syllabus. Contents
I PUC - Computer Science Practical s Syllabus Contents Topics 1 Overview Of a Computer 1.1 Introduction 1.2 Functional Components of a computer (Working of each unit) 1.3 Evolution Of Computers 1.4 Generations
Universidad Carlos III de Madrid
Universidad Carlos III de Madrid Algorithms and Data Structures (ADS) Bachelor in Informatics Engineering Computer Science Department Lists, Stacks and Queues. Authors: Isabel Segura Bedmar April 2011
COMPUTER SCIENCE. Paper 1 (THEORY)
COMPUTER SCIENCE Paper 1 (THEORY) (Three hours) Maximum Marks: 70 (Candidates are allowed additional 15 minutes for only reading the paper. They must NOT start writing during this time) -----------------------------------------------------------------------------------------------------------------------
Data Structures and Algorithm Analysis (CSC317) Intro/Review of Data Structures Focus on dynamic sets
Data Structures and Algorithm Analysis (CSC317) Intro/Review of Data Structures Focus on dynamic sets We ve been talking a lot about efficiency in computing and run time. But thus far mostly ignoring data
AFF 808. Sub. Code 4BIT1C1. B.Sc. DEGREE EXAMINATION, NOVEMBER 2015. First Semester. Information Technology
Ws4 AFF 808 Sub. Code 4BITC B.Sc. DEGREE EXAMINATION, NOVEMBER 05 First Semester Information Technology PRINCIPLES OF INFORMATION TECHNOLOGY AND OS (CBCS 04 onwards) Time : 3 Hours Maximum : 75 Marks Part
Introduction to Data Structures and Algorithms
Introduction to Data Structures and Algorithms Chapter: Elementary Data Structures(1) Lehrstuhl Informatik 7 (Prof. Dr.-Ing. Reinhard German) Martensstraße 3, 91058 Erlangen Overview on simple data structures
Previous Lectures. B-Trees. External storage. Two types of memory. B-trees. Main principles
B-Trees Algorithms and data structures for external memory as opposed to the main memory B-Trees Previous Lectures Height balanced binary search trees: AVL trees, red-black trees. Multiway search trees:
A binary search tree is a binary tree with a special property called the BST-property, which is given as follows:
Chapter 12: Binary Search Trees A binary search tree is a binary tree with a special property called the BST-property, which is given as follows: For all nodes x and y, if y belongs to the left subtree
Data Structures Using C++
Data Structures Using C++ 1.1 Introduction Data structure is an implementation of an abstract data type having its own set of data elements along with functions to perform operations on that data. Arrays
Data Structures Fibonacci Heaps, Amortized Analysis
Chapter 4 Data Structures Fibonacci Heaps, Amortized Analysis Algorithm Theory WS 2012/13 Fabian Kuhn Fibonacci Heaps Lacy merge variant of binomial heaps: Do not merge trees as long as possible Structure:
1.2 Solving a System of Linear Equations
1.. SOLVING A SYSTEM OF LINEAR EQUATIONS 1. Solving a System of Linear Equations 1..1 Simple Systems - Basic De nitions As noticed above, the general form of a linear system of m equations in n variables
Analysis of Algorithms I: Binary Search Trees
Analysis of Algorithms I: Binary Search Trees Xi Chen Columbia University Hash table: A data structure that maintains a subset of keys from a universe set U = {0, 1,..., p 1} and supports all three dictionary
22c:31 Algorithms. Ch3: Data Structures. Hantao Zhang Computer Science Department http://www.cs.uiowa.edu/~hzhang/c31/
22c:31 Algorithms Ch3: Data Structures Hantao Zhang Computer Science Department http://www.cs.uiowa.edu/~hzhang/c31/ Linear Data Structures Now we can now explore some convenient techniques for organizing
Big Data and Scripting. Part 4: Memory Hierarchies
1, Big Data and Scripting Part 4: Memory Hierarchies 2, Model and Definitions memory size: M machine words total storage (on disk) of N elements (N is very large) disk size unlimited (for our considerations)
Sequential Data Structures
Sequential Data Structures In this lecture we introduce the basic data structures for storing sequences of objects. These data structures are based on arrays and linked lists, which you met in first year
Sorting revisited. Build the binary search tree: O(n^2) Traverse the binary tree: O(n) Total: O(n^2) + O(n) = O(n^2)
Sorting revisited How did we use a binary search tree to sort an array of elements? Tree Sort Algorithm Given: An array of elements to sort 1. Build a binary search tree out of the elements 2. Traverse
S. Muthusundari. Research Scholar, Dept of CSE, Sathyabama University Chennai, India e-mail: [email protected]. Dr. R. M.
A Sorting based Algorithm for the Construction of Balanced Search Tree Automatically for smaller elements and with minimum of one Rotation for Greater Elements from BST S. Muthusundari Research Scholar,
