Algorithms and Data Structures in Python (INTERVIEW Q&A)

Algorithms and Data Structures in Python (INTERVIEW Q&A)

English | MP4 | AVC 1280×720 | AAC 44KHz 2ch | 18h 22m | 3.74 GB

A guide to implement data structures, graph algorithms and sorting algorithms from scratch with interview questions!

This course is about data structures, algorithms and graphs. We are going to implement the problems in Python programming language. I highly recommend typing out these data structures and algorithms several times on your own in order to get a good grasp of it.

So what are you going to learn in this course?

Section 1:

  • setting up the environment
  • differences between data structures and abstract data types

Section 2 – Arrays:

  • what is an array data structure
  • arrays related interview questions

Section 3 – Linked Lists:

  • linked list data structure and its implementation
  • doubly linked lists
  • linked lists related interview questions

Section 4 – Stacks and Queues:

  • stacks and queues
  • stack memory and heap memory
  • how the stack memory works exactly?
  • stacks and queues related interview questions

Section 5 – Binary Search Trees:

  • what are binary search trees
  • practical applications of binary search trees
  • problems with binary trees

Section 6 – Balanced Binary Trees (AVL Trees and Red-Black Trees):

  • why to use balanced binary search trees
  • AVL trees
  • red-black trees

Section 7 – Priority Queues and Heaps:

  • what are priority queues
  • what are heaps
  • heapsort algorithm overview

Section 8 – Hashing and Dictionaries:

  • associative arrays and dictionaries
  • how to achieve O(1) constant running time with hashing

Section 9 – Graph Traversal:

  • basic graph algorithms
  • breadth-first
  • depth-first search
  • stack memory visualization for DFS

Section 10 – Shortest Path problems (Dijkstra’s and Bellman-Ford Algorithms):

  • shortest path algorithms
  • Dijkstra’s algorithm
  • Bellman-Ford algorithm
  • how to detect arbitrage opportunities on the FOREX?

Section 11 – Spanning Trees (Kruskal’s and Prim’s Approaches):

  • what are spanning trees
  • what is the union-find data structure and how to use it
  • Kruskal’s algorithm theory and implementation as well
  • Prim’s algorithm

Section 12 – Sorting Algorithms

  • sorting algorithms
  • bubble sort, selection sort and insertion sort
  • quicksort and merge sort
  • non-comparison based sorting algorithms
  • counting sort and radix sort

In the first part of the course we are going to learn about basic data structures such as linked lists, stacks, queues, binary search trees, heaps and some advanced ones such as AVL trees and red-black trees.. The second part will be about graph algorithms such as spanning trees, shortest path algorithms and graph traversing. We will try to optimize each data structure as much as possible.

In each chapter I am going to talk about the theoretical background of each algorithm or data structure, then we are going to write the code step by step in Python.

Most of the advanced algorithms relies heavily on these topics so it is definitely worth understanding the basics. These principles can be used in several fields: in investment banking, artificial intelligence or electronic trading algorithms on the stock market. Research institutes use Python as a programming language in the main: there are a lot of library available for the public from machine learning to complex networks.

What you’ll learn

  • Understand arrays and linked lists
  • Understand stacks and queues
  • Understand tree like data structures (binary search trees)
  • Understand balances trees (AVL trees and red-black trees)
  • Understand heap data structures
  • Understand hashing, hash tables and dictionaries
  • Understand the differences between data structures and abstract data types
  • Understand graph traversing (BFS and DFS)
  • Understand shortest path algorithms such as Dijkstra’s approach or Bellman-Ford method
  • Understand minimum spanning trees (Prims’s algorithm)
  • Understand sorting algorithms
  • Be able to develop your own algorithms
  • Have a good grasp of algorithmic thinking
  • Be able to detect and correct inefficient code snippets
Table of Contents

Introduction
1 Introduction
2 Complexity theory basics

Data Structures Overview
3 Why to use data structures
4 Data structures and abstract data types

Installation and Environment Setup
5 Installing Python and PyCharm on Mac
6 Installing Python and PyCharm on Windows

Data Structures – Arrays
7 What are array data structures
8 Arrays introduction – operations
9 Arrays in Python
10 What are real arrays in Python

Interview Questions (Arrays)
11 Reversing an array in-place solution
12 Palindrome problem solution
13 Integer reversion problem solution
14 Anagram problem solution
15 Duplicates in an array problem solution
16 Anagram problem overview
17 Duplicates in an array problem overview
18 Integer reversion problem overview
19 Palindrome problem overview
20 Reversing an array in-place overview

Data Structures – Linked Lists
21 What are linked lists
22 Linked list introduction – operations
23 Linked list implementation I
24 Linked list implementation II
25 Linked list implementation III
26 Comparing linked lists and arrays
27 Practical (real-world) applications of linked lists

Data Structures – Doubly Linked Lists
28 What are doubly linked lists
29 Doubly linked list implementation
30 Running time comparison linked lists and arrays

Interview Questions (Linked Lists)
31 Finding the middle node in a linked list solution
32 Reverse a linked list in-place solution
33 Finding the middle node in a linked list overview
34 Reverse a linked list in-place overview

Data Structures – Stacks
35 What are stacks
36 Stacks in memory management (stacks and heaps )
37 Stack memory visualization
38 Stack implementation
39 Practical (real-world) applications of stacks

Data Structures – Queues
40 What are queues
41 Queue implementation

Interview Questions (Stacks and Queues)
42 Max in a stack problem solution
43 Queue with stack problem solution
44 Queue with stack problem solution – recursion
45 Max in a stack problem overview
46 Queue with stack problem

Data Structures – Binary Search Trees
47 What are binary search trees
48 Binary search trees theory – search, insert
49 Binary search trees theory – delete
50 Binary search trees theory – in-order traversal
51 Binary search trees theory – running times
52 Binary search tree implementation I
53 Binary Search Tree implementation II
54 Stack memory visualization – finding max (min) items
55 Stack memory visualization – tree traversal
56 Binary Search Tree implementation III
57 Practical (real-world) applications of trees

Interview Questions (Binary Search Trees)
58 Compare binary trees solution
59 Compare binary trees overview

Data Structures – AVL Trees
60 Motivation behind balanced binary search trees
61 What are AVL trees
62 AVL trees introduction – height
63 AVL trees introduction – rotations
64 AVL trees introduction – illustration
65 AVL tree implementation I
66 AVL tree implementation II
67 AVL tree implementation III
68 AVL tree implementation IV
69 AVL tree implementation V
70 Practical (real-world) applications of balanced binary search trees

Data Structures – Red-Black Trees
71 What are red-black trees
72 The logic behind red-black trees
73 Red-black trees – recoloring and rotation cases
74 Red-black tree illustrations
75 Red-black tree implementation I
76 Red-black tree implementation II
77 Red-black tree implementation III
78 Red-black tree implementation IV
79 Differences between red-black tree and AVL trees

Data Structures – Heaps
80 What are priority queues
81 Heap introduction – basics
82 Heap introduction – array representation
83 Heap introduction – remove operation
84 Using heap data structure to sort (heapsort)
85 Heap introduction – operations complexities
86 Binomial and Fibonacci heaps
87 Heap implementation I
88 Heap implementation II
89 Heap implementation III
90 Heaps in Python

Interview Questions (Heaps)
91 Interview question #1 – solution
92 Interview question #2 – solution
93 Interview question #1 – checking heap properties
94 Interview question #2 – max heap to a min heap

Data Structures – Associative Arrays (Dictionaries)
95 What are associative arrays
96 Hashtable introduction – basics
97 Hashtable introduction – collisions
98 Hashtable introduction – dynamic resizing
99 Linear probing implementation I
100 Linear probing implementation II
101 Linear probing implementation III
102 Dictionaires in Python
103 Practical (real-world) applications of hashing

Graph Algorithms Overview
104 Graph theory overview
105 Adjacency matrix and adjacency list
106 Applications of graphs

Graph Algorithms – Graph Traversal Algorithms
107 Breadth-first search introduction
108 Breadth-first search implementation
109 What are WebCrawlers (core of search engines)
110 WebCrawler basic implementation
111 Depth-first search introduction
112 Depth-first search implementation
113 Memory management BFS vs DFS
114 Depth-first search implementation II

Interview Questions (Graph Traversal)
115 Interview question #1 – solution
116 Depth-first search and stack memory visualisation
117 Interview question #2 – solution
118 Interview question #1 – implement DFS with recursion
119 Interview question #2 – using BFS to find way out of maze

Graph Algorithms – Shortest Paths with Dijkstra’s Algorithm
120 What is the shortest path problem
121 Dijkstra algorithm visualization
122 Dijkstra algorithm implementation I – Edge, Node
123 Dijkstra algorithm implementation II – algorithm
124 Dijkstra algorithm implementation III – testing
125 Dijktsra’s algorithm with adjacency matrix representation
126 Adjacency matrix representation implementation
127 Shortest path algorithms applications
128 What is the critical path method (CPM)

Graph Algorithms – Shortest Paths with Bellman-Ford Algorithm
129 What is the Bellman-Ford algorithm
130 Bellman-Ford algorithm visualization
131 Bellman-Ford algorithm implementation I – Node, Edge
132 Bellman-Ford algorithm implementation II – the algorithm
133 Bellman-Ford algorithm implementation III – testing
134 Greedy algorithm or dynamic programming approach

Interview Questions (Shortest Paths)
135 How to use Bellman-Ford algorithm on the FOREX
136 Interview question #1 – solution
137 Interview question #1 – detecting negative cycles on the FOREX

Graph Algorithms – Spanning Trees with Kruskal Algorithm
138 What is the disjoint set data structure
139 Disjoint sets visualization
140 Kruskal’s algorithm introduction
141 Kruskal algorithm implementation I – basic classes
142 Kruskal algorithm implementation II – disjoint set
143 Kruskal algorithm implementation III – algorithm
144 Kruskal algorithm implementation VI – testing

Graph Algorithms – Spanning Trees with Prims Algorithm
145 What is the Prim-Jarnik algorithm
146 Prims-Jarnik algorithm implementation I
147 Prims-Jarnik algorithm implementation II
148 Applications of spanning trees

Basic Sorting Algorithms
149 Sorting introduction
150 What is stability in sorting
151 What is adaptive sorting
152 Bogo sort introduction
153 Bogo sort implementation
154 Bubble sort introduction
155 Bubble sort implementation
156 Selection sort introduction
157 Selection sort implementation
158 Insertion sort introduction
159 Insertion sort implementation
160 Shell sort introduction
161 Shell sort implementation
162 Quicksort introduction
163 Quicksort introduction – example
164 Quicksort implementation
165 What is the worst-case scenario for quicksort
166 Merge sort introduction
167 Merge sort implementation
168 Stack memory and merge sort visualization
169 Hybrid algorithms introduction
170 Non-comparison based algorithms
171 Counting sort introduction
172 Counting sort implementation
173 Radix sort introduction
174 Radix sort implementation
175 Exercise – sorting custom objects with insertion sort
176 Hoare’s partitioning and Lomuto’s partitioning
177 Measure running time differences
178 Solution – sorting custom objects with insertion sort
179 Visualizing sorting algorithms with Algorhyme

Interview Questions (Sorting)
180 Interview question #1 – solution
181 Interview question #1 – implementing TimSort algorithm
182 Interview question #2 – implement quicksort with iteration
183 Interview question #2 – solution
184 Interview question #3 – solution
185 Interview question #3 – implementing selection sort with recursion

Next Steps
186 Next steps

Course Materials (DOWNLOADS)
187 Download course materials (slides and source code)

Algorhyme FREE Algorithms Visualizer App
188 Algorithms Visualization App
189 Algorhyme – Algorithms and Data Structures

Homepage