Lec%201%20Abstract%20Data%20%26%20Type.pdf

Full Transcript

DATA STRUCTURE ALGORITHIM DATA STRUCTURE ALGORITHM Lecture 1 COURSE INFORMATION Textbooks Introduction to Data Structures by Ashok N. Kamthane Data Structures an...

DATA STRUCTURE ALGORITHIM DATA STRUCTURE ALGORITHM Lecture 1 COURSE INFORMATION Textbooks Introduction to Data Structures by Ashok N. Kamthane Data Structures and Algorithms by A. V. Aho, J. E. Hopcroft, J. D. Ullman Data Structures Using C and C++ by Y. Langsam, M. J. Augenstein, A. M. Tenenbaum DATA STRUCTURE ALGORITHM Lecture 1 COURSE OUTLINE Introduction to Data Structure Algorithms Recursion Stacks Queues Lists and linked lists Trees Sorting Searching Graphs Hashing DATA STRUCTURE ALGORITHM Lecture 1 GRADING Theory Quizzes ---------------10% Assignments---------10% Mid Term-------------- 30% Final-------------------- 50% Labs Assignments/Exercises and Project------ 50% Mid term------------------------------ 20% Final----------------------------------- 30% DATA STRUCTURE ALGORITHM Lecture 1 INTRODUCTION TO DATA STRUCTURE AND ABSTRACT DATA TYPES Lecturer Zeeshan Rasheed DATA STRUCTURE ALGORITHM Lecture 1 WHAT IS DATA? Data represents the raw facts and figures which can be used in such a manner in order to capture the useful information out of it. OR Data is any information in raw or organized form using alphabets, numbers or symbols, images and video is known as data DATA STRUCTURE ALGORITHM Lecture 1 WHAT IS DATA STRUCTURE? Data structure is a representation of data and the operations allowed on that data. A data structure is a way to store and organize data in order to facilitate the access and modifications. Data Structure are the method of representing of logical relationships between individual data elements related to the solution of a given problem. DATA STRUCTURE ALGORITHM Lecture 1 BASIC DATA STRUCTURE Basic Data Structures Linear Data Structures Non-Linear Data Structures Arrays Linked Lists Stacks Queues Trees Graphs Hash Tables DATA STRUCTURE ALGORITHM Lecture 1 array Linked list queue tree stack DATA STRUCTURE ALGORITHM Lecture 1 SELECTION OF DATA STRUCTURE The choice of particular data model depends on two consideration: It must be rich enough in structure to represent the relationship between data elements The structure should be simple enough that one can effectively process the data when necessary DATA STRUCTURE ALGORITHM Lecture 1 TYPES OF DATA STRUCTURE Linear: In Linear data structure, values are arrange in linear fashion. Array: Fixed-size Linked-list: Variable-size Stack: Add to top and remove from top Queue: Add to back and remove from front Priority queue: Add anywhere, remove the highest priority DATA STRUCTURE ALGORITHM Lecture 1 TYPES OF DATA STRUCTURE Non-Linear: The data values in this structure are not arranged in order. Hash tables: Unordered lists which use a ‘hash function’ to insert and search Tree: Data is organized in branches. Graph: A more general branching structure, with less strict connection conditions than for a tree DATA STRUCTURE ALGORITHM Lecture 1 TYPE OF DATA STRUCTURES Homogenous: In this type of data structures, values of the same types of data are stored. Array Non-Homogenous: In this type of data structures, data values of different types are grouped and stored. Structures Classes DATA STRUCTURE ALGORITHM Lecture 1 ABSTRACT DATA TYPE AND DATA STRUCTURE Definition:- Abstract Data Types (ADTs) stores data and allow various operations on the data to access and change it. A mathematical model, together with various operations defined on the model An ADT is a collection of data and associated operations for manipulating that data Data Structures Physical implementation of an ADT data structures used in implementations are provided in a language (primitive or built-in) or are built from the language constructs (user- defined) Each operation associated with the ADT is implemented by one or more subroutines in the implementation DATA STRUCTURE ALGORITHM Lecture 1 ABSTRACT DATA TYPE ADTs support abstraction, encapsulation, and information hiding. Abstraction is the structuring of a problem into well-defined entities by defining their data and operations. The principle of hiding the used data structure and to only provide a well-defined interface is known as encapsulation. DATA STRUCTURE ALGORITHM Lecture 1 THE CORE OPERATIONS OF ADT Every Collection ADT should provide a way to:  add an item  remove an item  find, retrieve, or access an item Many, many more possibilities  is the collection empty  make the collection empty  give me a sub set of the collection DATA STRUCTURE ALGORITHM Lecture 1 No single data structure works well for all purposes, and so it is important to know the strengths and limitations of several of them DATA STRUCTURE ALGORITHM Lecture 1 STACKS Collection with access only to the last element inserted Last in first out Data4 Top insert/push Data3 remove/pop top Data2 make empty Data1 DATA STRUCTURE ALGORITHM Lecture 1 QUEUES Collection with access only to the item that has been present the longest Last in last out or first in first out enqueue, dequeue, front priority queues and dequeue Front Back Data1 DATA STRUCTURE ALGORITHM Data2 Data3 Data4 Lecture 1 LIST A Flexible structure, because can grow and shrink on demand. Elements can be: ▪ Inserted ▪ Accessed ▪ Deleted At any position last first DATA STRUCTURE ALGORITHM Lecture 1 TREE A Tree is a collection of elements called nodes. One of the node is distinguished as a root, along with a relation (“parenthood”) that places a hierarchical structure on the nodes. Root DATA STRUCTURE ALGORITHM Lecture 1

Use Quizgecko on...
Browser
Browser