100% found this document useful (1 vote)
607 views166 pages

DSA Organizer 3rd Sem

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF or read online on Scribd
100% found this document useful (1 vote)
607 views166 pages

DSA Organizer 3rd Sem

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF or read online on Scribd
You are on page 1/ 166
For 3" Semester DATA STRUCTURE. | & ALGORITH & RGANIZES Organizer Data Structure & Algorithms Computer Branch Tilia Sem. | Strictly as per new syllabus | . Aditya Prakashan . Po Data Structure & Algorithms Copyright © by Adityn Prakashan All rights reserved, No part of this publication may be reproduced, copied, or stored in a retrieval system, distributed or transmitted in any form or by any means, in- cluding photocopy, recording, or other electronic or mechanical meth- ‘ods, without the prior written permission of the publisher. This book is sold subject to the condition that it shall not, by the way of trade or otherwise, by lent, resold, hired out, or otherwise circu- lated without the publisher's prior written consent in any forms be binding or cover other than which it is published and without a simi- lar condition including this condition being imposed on the subse- quent purchaser and without limiting the rights under copyright re- served above. Printed at : Gayatri Offset, Published by : Aditya Prakashan Branch Office: Naya Tola patna Mobile : 9473307711 Aditya Book Code - DSA 0032 Modute 1: Lecture 4 hrs. Introduction : Bsic ‘Terminologies : Elementary Data Organizations, Data Structure Operations; insertion, deletion, traversal ete.; Analysis of an Algorithm, Asymptotic Notations, Time-Space trade off Module 2: Lecture 10 hrs. Stacks and Queues : ADT Stack and its operations ; Algorithms and their complexity analysis, Applications of Stacks : Expression Conversion and evaoluation corresopnding algorithms and complexity analysis. ADT queue, Types of Queue : Simple Queue, Circular Queue, Priority Queue; Operations on each Type of Queues : Algorithm and their analysis. Module 3 : Lecture 6 hrs. Linked Lists : Singly linked lists : Representation in memory, Algorithms of several operations : Traversing, Searching, Insertion into, Deletion from linked list; Linked representation of Stack and Queue, Header nodes, doubly linked list; operations on it and algorithmic analysis; Circular Linked Lists; all Operations their algorithms and th complexity analysis. Module 4 Lecture 12 hrs. Searching, Sorting and Hashing : Linear and Binary Search Technique and their complexity analysis. Objective and properties of different sorting algorithms Section. Sort, Bubble Sort, Insertion Sort, Quick Sort, Merge Sort, Heap Sort; Performance and Comparison among all the methods; Hashing. Module 5 Lecturs 8 hrs. Trees : Basic Tree Terminologies, Different types of Trees; Binary Tree, Threaded Binary Tree, Binary Search Tree, AVL Tree; Tree operations on each of the trees and their algorithms with complexity analysis. Applications of Binary Trees. B Tree, B* Tree : definitions, algorithms and analysis, Graph : Basic Terminologies and Representations, Graph search and traversal algo- rithms and complexity analysis. Introduction + Bsic Terminologies : Elementary Data Organizations, Data Structure Perations; insertion, deletion, traversal ete.; Analysis of an Algorithm, Asymptotic Notations, Time-Space trade off, : Module 2 ; Module 1 ; gorithms and their complexity, : icks : Expression Conversion and evaoluation Corresopnding algorithms and complexity analysis, ADT queue, Types of Queue : Simple Queue, Circular Queue, Priority Queue; Operations on each Type of Queues : Algorithm and their analysis, Module 3: Linked Lists : Singly linked lists : Representation in memory, Algorithms of several Operations : Traversing, Searching, Insertion into, Deletion from linked list; Linked Tepresentation of Stack and Queue, Header nodes, doubly linked list; operations on it and algorithmic analysis; Circular Linked Lists; all operations their algorithms and th complexity analysis, : Module 4 Searching, Sorting and Hashing : Linear and Binary Search Technique and their complexity analysis. Objective and properties of different sorting algorithms Section Sort, Bubble Sort, Insertion Sort, Quick Sort, Merge Sort, Heap Sort; Performance and Comparison among all the methods, Hashing. Module 5 Trees : Basic Tree Terminologies, Different types of Trees; Binary Tree, Threaded Binary Tree, Binary Search Tree, AVL Tree; Tree operations on each of the trees and their algorithms with complexity analysis. Applications of Binary Trees, B Tree, B’ Tree : definitions, algorithms and analysis. Graph : Basic Terminologies and Representations, Graph search and traversal algo- rithms and complexity analysis. INTRODUCTION _— & Chapter at a Glance : © Data (plural of "datuni"), refers to qualitative or quantitative attributes of a variable or set of veriables. Typically, data are the results of measurements and can be the basis of graphs, images or observations of a set of variables. © Metadatn is a data, containing a description of other data, Earlier term for metadata is ‘ancillary data, © Data structure: Data may be organized in many different ways. The logical or mathematical model of a particular organization of data is called data structure, © Classification: Data structure can be classified as linear and non-linear. Linear data structure: The data structure is said to be linear, if its element.forms a sequence cor linear list, Linear data stiuctures organize their data elements in a linear fashion: Non-linear data structure: In nonlinear data structures, data elements are not organized in a sequential fashion. A data item in a nonlinear data structure could be attached to several other deta elements to reflect a special relationship among them and all the data items cannot be traversed in a single run. “ : * Various operations can be performed on data structure. List of some frequently used operations are given below: 1. Traversing: sometimes also called as visiting, means accessing the required record so as to process the data, : 2. Searching: finding the location of record to be processed. 3. Inserting: adding a new recofd to the structure 4. Deleting: removing the record from the structure. 5. Sorting: arranging the record in some logical order. 6. Merging: combining two different sets of records to form a final set of records. * Abstract data type (ADT): Abstract Data Types are a set of data values and associated operations that are precisely independent of any particular implementation. The term abstract signifies that the data type will only set the rule of it's usage but how it will be used depends on the implementation, For-example stacks and queues are called abstract data types. The stack data type defines two abstract methods PUSH and POP. © The basic properties of an algorithm are: Input: Each algorithm is supplied with a zero or more external quantities. : Each .algorithm must produce atleast one quantity. Definiteness: Each instruction myst be clear and unambiguous. Finiteness: The algorithm must terminate after a finite number of steps wit Effectiveness: Each instruction must be sufficiently basic and also be feasible, © Analysis of an algorithm means, to determine the amount of resources (such as time and storage) necessary (o execute it. Most algorithms are designed to work with inputs of arbitrary length. Usually the efficiency or running time of an algorithm Is stated as a function relating the input length to the number of steps (time complexity) or storage locations (space complexity). * In theoretical analysis of algorithms it is common to estimate their complexity in the asymptotic sense, i.e., to estimate the complexity function for arbitrarily large input. Big O finite ti me, INTRODUCTION a @ Chapter at a Glance : /e or quantitative attributes of a variable or set of © Data (plural of "datum"), refers to qualitativ Tneasurements and cin be the basis. of graphs, ~ variables. Typically; data are the results of images or observations ofa set of variables. * Metadata is a data, containing a description of other data, Earlier term for, metadata is ancillary data, © Data structure: Data may be organized in many different ways. The logical or mathematical model of a particular organization of data is called data structure. sitet ete: * Classification: Data structure can be classified as fiwear and non-linear. ; Linear data structure: The data structure is said to be linear, if its element forms a sequence -or linear list. Linear data structures organize their data.elements in a linear fashion.” Non-linear data structui ear data structures, data elements are not organized in a sequential fashiori: A data item in.a nonlinear data structure could be attached to sevesal.other, data elements to reflect a special relationship among them and, all the data items ‘cannot be traversed iniasingierun." * +. . Various operations can be: performed, on data structure. List, of some ‘frequently used operations are given below: 1. Traversing: sometimes aléo called as visiting, means accessing the required record 50 as to process the data. 2. Searching: findirig the location of record to’be processed. 3. Insertin, ddding a new. record to the structure removing the record from the stricture. 5. Sorting: arranging the record in some logical order.~ 6. Merging: combining two different sets of records to'form a final set of records. © Abstract data type (ADT): Abstract ‘Data Types are a set of data values and associated operations that are'precisely independent of any particular implementation: The teri abstract Signifies that the, data type will only set.the rule of it’s-usage but how it will be used depends on the implementation. For-example stacks and.queues are called. abstract. datatypes. The stack data type defines two abstract methods PUSH and POP. © The basic properties of an algorithm are: Input: Each sch algorithm is supplied with'a zero or more asain vanes: i ‘Output: Each