Data Structures Using Python
(R20A0503)LECTURE NOTES
B.TECHIIYEAR–I-SEM
(R20)(2021-2022)
MALLAREDDYCOLLEGEOFENGINEERING&TECHNOLOGY
(AutonomousInstitution– UGC,Govt.ofIndia)
Recognizedunder2(f)and12(B)ofUGCACT 1956
(AffiliatedtoJNTUH,Hyderabad,ApprovedbyAICTE-AccreditedbyNBA&NAAC –‘A’Grade-ISO9001:2015Certified)
Maisammaguda,Dhulapally(PostVia.Hakimpet),Secunderabad–500100,TelanganaState,India
1
, SYLLABUS
MALLAREDDYCOLLEGEOFENGINEERING ANDTECHNOLOGY
IIYearB.Tech CSE-I SEM L T/P/DC
3 -/ -/ -3
(R20A0503)DATA STRUCTURES USING PYTHON
COURSE OBJECTIVES:
This course will enable students to
1. Implement Object Oriented Programming concepts in Python.
2. Understand Lists, Dictionaries and Regular expressions in Python.
3. Understanding how searching and sorting is performed in Python.
4. Understanding how linear and non-linear data structures works.
5. To learn the fundamentals of writing Python scripts.
UNIT – I
Oops Concepts- class, object, constructors, types of variables, types of methods. Inheritance: single, multiple,
multi-level, hierarchical, hybrid, Polymorphism: with functions and objects, with class methods, with
inheritance,Abstraction: abstract classes.
UNIT – II
Data Structures – Definition,Linear Data Structures,Non-Linear Data Structures
Python Specific Data Structures: List,Tuples, Set, Dictionaries, Comprehensions and its Types,Strings,slicing.
UNIT -III
Arrays - Overview, Types of Arrays, Operations on Arrays, Arrays vs List.
Searching -Linear Search and Binary Search.
Sorting - Bubble Sort, Selection Sort, Insertion Sort, Merge Sort, Quick Sort.
UNIT -IV
Linked Lists – Implementation ofSingly Linked Lists, Doubly Linked Lists, Circular Linked Lists.
Stacks - Overview of Stack, Implementation of Stack (List & Linked list), Applications of Stack
Queues:Overview of Queue, Implementation of Queue(List & Linked list), Applications of Queues, Priority
Queues.
UNIT -V
Graphs -Introduction, Directed vs Undirected Graphs, Weighted vs Unweighted Graphs, Representations, Breadth
First Search, Depth First Search.
Trees - Overview of Trees, Tree Terminology, Binary Trees: Introduction, Implementation, Applications. Tree
Traversals, Binary Search Trees: Introduction, Implementation, AVL Trees: Introduction, Rotations,
Implementation.
TEXTBOOKS:
1. Data structures and algorithms in python by Michael T. Goodrich
2. Data Structures and Algorithmic Thinking with Python by NarasimhaKarumanchi
2
,REFERENCE BOOKS:
1. Hands-On Data Structures and Algorithms with Python: Write complex and powerful code using the latest
features of Python 3.7, 2nd Edition by Dr. Basant Agarwal, Benjamin Baka.
2. Data Structures and Algorithms with Python by Kent D. Lee and Steve Hubbard.
3. Problem Solving with Algorithms and Data Structures Using Python by Bradley N Miller and David L.
Ranum.
4. Core Python Programming -Second Edition,R. Nageswara Rao, Dreamtech Press
COURSE OUTCOMES:
The students should be able to:
1. Examine Python syntax and semantics and apply Python flow control and functions.
2. Create, run and manipulate Python Programs using core data structures like Lists,
3. Apply Dictionaries and use Regular Expressions.
4. Interpret the concepts of Object-Oriented Programming as used in Python.
5. Master object-oriented programming to create an entire python project using objects and classes
3
, INDEX
UNIT TOPIC PAGENO
Class ,Objects, Constructors
6-9
Types of Variables 10-12
Types of Methods 12-15
Inheritance & Types 16-21
Polymorphism 22-26
I Abstract Classes 27-28
Introduction to Data Structures, Types 29-31
Python Specific Data Structures 31-43
II
Sequences 44-49
Comprehensions-List,Tuples,Set,Dictonary 50-52
String Slicing 53-55
Arrays&operations on Arrays 56-61
Searching: Linear Search, Binary search 62-68
Sorting:Bubble,Selction,Insertion,Merge,Quick 68-77
Sort Techniques
III
Linked List: Single ,Double, Circular Linked List 78-85
IV Stacks:Operations,Implementation using List 86-92
,Linked List
i
Queues:Operations,Implementation using List 93-105
,Linked List
Priority Queues 106-111
4
(R20A0503)LECTURE NOTES
B.TECHIIYEAR–I-SEM
(R20)(2021-2022)
MALLAREDDYCOLLEGEOFENGINEERING&TECHNOLOGY
(AutonomousInstitution– UGC,Govt.ofIndia)
Recognizedunder2(f)and12(B)ofUGCACT 1956
(AffiliatedtoJNTUH,Hyderabad,ApprovedbyAICTE-AccreditedbyNBA&NAAC –‘A’Grade-ISO9001:2015Certified)
Maisammaguda,Dhulapally(PostVia.Hakimpet),Secunderabad–500100,TelanganaState,India
1
, SYLLABUS
MALLAREDDYCOLLEGEOFENGINEERING ANDTECHNOLOGY
IIYearB.Tech CSE-I SEM L T/P/DC
3 -/ -/ -3
(R20A0503)DATA STRUCTURES USING PYTHON
COURSE OBJECTIVES:
This course will enable students to
1. Implement Object Oriented Programming concepts in Python.
2. Understand Lists, Dictionaries and Regular expressions in Python.
3. Understanding how searching and sorting is performed in Python.
4. Understanding how linear and non-linear data structures works.
5. To learn the fundamentals of writing Python scripts.
UNIT – I
Oops Concepts- class, object, constructors, types of variables, types of methods. Inheritance: single, multiple,
multi-level, hierarchical, hybrid, Polymorphism: with functions and objects, with class methods, with
inheritance,Abstraction: abstract classes.
UNIT – II
Data Structures – Definition,Linear Data Structures,Non-Linear Data Structures
Python Specific Data Structures: List,Tuples, Set, Dictionaries, Comprehensions and its Types,Strings,slicing.
UNIT -III
Arrays - Overview, Types of Arrays, Operations on Arrays, Arrays vs List.
Searching -Linear Search and Binary Search.
Sorting - Bubble Sort, Selection Sort, Insertion Sort, Merge Sort, Quick Sort.
UNIT -IV
Linked Lists – Implementation ofSingly Linked Lists, Doubly Linked Lists, Circular Linked Lists.
Stacks - Overview of Stack, Implementation of Stack (List & Linked list), Applications of Stack
Queues:Overview of Queue, Implementation of Queue(List & Linked list), Applications of Queues, Priority
Queues.
UNIT -V
Graphs -Introduction, Directed vs Undirected Graphs, Weighted vs Unweighted Graphs, Representations, Breadth
First Search, Depth First Search.
Trees - Overview of Trees, Tree Terminology, Binary Trees: Introduction, Implementation, Applications. Tree
Traversals, Binary Search Trees: Introduction, Implementation, AVL Trees: Introduction, Rotations,
Implementation.
TEXTBOOKS:
1. Data structures and algorithms in python by Michael T. Goodrich
2. Data Structures and Algorithmic Thinking with Python by NarasimhaKarumanchi
2
,REFERENCE BOOKS:
1. Hands-On Data Structures and Algorithms with Python: Write complex and powerful code using the latest
features of Python 3.7, 2nd Edition by Dr. Basant Agarwal, Benjamin Baka.
2. Data Structures and Algorithms with Python by Kent D. Lee and Steve Hubbard.
3. Problem Solving with Algorithms and Data Structures Using Python by Bradley N Miller and David L.
Ranum.
4. Core Python Programming -Second Edition,R. Nageswara Rao, Dreamtech Press
COURSE OUTCOMES:
The students should be able to:
1. Examine Python syntax and semantics and apply Python flow control and functions.
2. Create, run and manipulate Python Programs using core data structures like Lists,
3. Apply Dictionaries and use Regular Expressions.
4. Interpret the concepts of Object-Oriented Programming as used in Python.
5. Master object-oriented programming to create an entire python project using objects and classes
3
, INDEX
UNIT TOPIC PAGENO
Class ,Objects, Constructors
6-9
Types of Variables 10-12
Types of Methods 12-15
Inheritance & Types 16-21
Polymorphism 22-26
I Abstract Classes 27-28
Introduction to Data Structures, Types 29-31
Python Specific Data Structures 31-43
II
Sequences 44-49
Comprehensions-List,Tuples,Set,Dictonary 50-52
String Slicing 53-55
Arrays&operations on Arrays 56-61
Searching: Linear Search, Binary search 62-68
Sorting:Bubble,Selction,Insertion,Merge,Quick 68-77
Sort Techniques
III
Linked List: Single ,Double, Circular Linked List 78-85
IV Stacks:Operations,Implementation using List 86-92
,Linked List
i
Queues:Operations,Implementation using List 93-105
,Linked List
Priority Queues 106-111
4