220 likes | 231 Views
Anjuman College of Engineering & Technology Computer Science & Engineering Department. Subject Code: BE4S2T Subject Name: Data Structures & Program Design Semester: 4 th Semester Prepared By. Prof.Farheena Shaikh. UNIT I
E N D
Anjuman College of Engineering & TechnologyComputer Science & Engineering Department Subject Code:BE4S2T Subject Name: Data Structures & Program Design Semester: 4th Semester Prepared By. Prof.Farheena Shaikh
UNIT I Introduction to algorithm, Time and space analysis of algorithms, Big oh and theta notations and omega notations, Average, best and worst case analysis, linear and binary search, selection sort, insertion sort, bubble sort, shell sort, Radix sort. Abstract data structure as an organization of data with specified properties and operations, General concepts of data structures. Representation of Arrays -Single and Multi dimensional. UNIT II List: - representation of ordered list using array and operation on it, sparse matrix, polynomial, Linked Lists, Simply linked list, Implementation of linked list using static and dynamic memory allocation, operations on linked list, polynomial representations and manipulations are using linked list, circular linked list, doubly linked list, Generalized list UNIT III Stack & Queue: Representation of Stack & queue using array and linked list, , Application of stacks, Conversion from infix to post fix and pre-fix expressions, Evaluation of postfix expression using stacks, Multiple stacks, Circular queues, Priority Queues, Dequeue. Syllabus
Continue…. UNIT IV Trees: General and binary trees, Representations and traversals, Threaded Binary Trees, Binary search trees, Applications, The concept of balancing and its advantages, B-Trees, B+ Trees, AVL Trees. UNIT V Graphs and digraphs: Representations, Breadth and depth first searches, connected component, spanning trees, shortest path–single source & all pairs , activity networks, topological sort, Hamiltonian path. UNIT VI Symbol Tables: static tree tables, dynamic tree tables, hash tables, hash functions, Collision resolution, overflow handling, Applications
COURSE OUTCOMES: CO1 Implement and analyze different searching and sorting algorithms. CO2 Develop ADT for Stack data structure and its applications. CO3 Develop ADT for Queue data structure and its applications. CO4 Demonstrate ability to apply knowledge of dynamic data structures like linked-lists and Extend its applications. CO5 Apply fundamentals of Tree data structures to implement Tree and problems including Tree traversals. CO6 Explain implementation of Graph data structure and Graph traversals.
Stacks • A stack is a non –primitive linear data structure. It is ordered list in which addition and deletion is done from only one end called stack top or top of stack(TOS). • The last added element will be the first to be removed from the stack top.
Continue……. • Stacks are also called Last In First Out (LIFO) data structures Operations performed on stacks Push: adds an element to the stack Pop: removes an element from the stack
Concept of Stacks Various types of stacks • Stack of Coins • Stack of Trays • Stack of Books • Stack of Boxes
Stack Terminology(PUSH) • Whenever a stack is created, the stack base remains fixed. • If a new element is added to the stack from the top, the top goes on increasing. • Figure shows various stages of stack top during insertion operation
Continue…. Stack Empty
Continue…. 0 topINSERTING ONE ELEMENT
Continue…. TOPInserting second element
Continue…. TOPInserting third element
Continue…. TOPInserting Fourth elementStack top increase during insertion
Stack Terminology(POP) • At the time of POP operation the element is deleted from the stack • The top most element of the stack is removed and the stack top is decreased. • Because the stack is follows last in first out strategy.
Deletion From Stack TOPStack initially
Continue…. TOPelement 40 deleted
Continue…. TOP element 30 deleted
Continue…. 0 top ELEMENT 20 deleted
Continue…. 0 ELEMENT 10 deleted top
Conclusion • After every PUSH operation the top of stack is increment by one and we enter elemet. • And after every POP operation the top of stack is decrement by one. • If there is no element in stack the stack is called empty stack