
Outline introduces big O notation and time and space complexity, then covers lists, stacks, queues, trees, graphs, sorting, and hashing, with Python use and interview-question practice to prepare for interviews.
Explore the big o notation and its implications for time and space complexity to analyze algorithms, using quick examples, theory, and practice.
Explore big O notation by comparing time and space complexity of algorithms, from brute-force linear search to binary search with logarithmic time, highlighting worst-case scenarios and growth rates.
Explore big o concepts through Python examples, comparing linear time, quadratic time, and logarithmic time, and illustrate nested loops versus halving inputs to reduce time.
Explore space complexity alongside time complexity, contrasting in-place (O(1) space) versus extra-memory approaches, with examples on n log n versus log n, recursion for factorial, and interview-level trade-offs in sorting.
Explore the first data structure by learning lists and arrays, uncover the theory behind how they work, and practice interview questions to solidify your understanding.
Compare arrays and lists to build intuition for data structures like stacks, queues, and decks. Explain memory layouts and differences, including contiguity, mutability, dynamic resizing, and the use of references.
Discover how lists extend by appending elements, how dynamic arrays allocate contiguous RAM, and how a 50% growth strategy balances time and space during growth.
Explore multiple approaches to detect duplicates, including brute force, sorting with two pointers, and a hash set solution, with discussions on time and space complexity.
Identify the single number in an array where every element appears twice, using a linear time, constant extra space technique, and consider the edge case of a single-element array.
Learn the single number problem using bit manipulation with xor, achieving linear time and constant space by canceling pairs in one pass; compare brute force, sorting, and two-pointers approaches.
Explore how to solve the majority element problem with a hash map and then implement the space efficient Boyer Moore algorithm for linear-time, constant-space results.
Explore stacks, queues, and deques, their differences, and practical implementations. Implement your own stack and queue and practice related interview questions.
Learn about stacks, queues, and deques, their push and pop semantics, and front and rear notions. Understand when to implement these structures in interviews and how they relate to lists.
Implement a stack from scratch in Python using a list, with push, pop, and show last, plus size and is_empty, and preview a queue and deck in upcoming lessons.
learn to implement a queue by building a Q class that uses a list, enqueuing at index 0 and dequeuing from the end, with is_empty and size.
Implement a deque using a list, with add left, add right, remove left, remove right, and size and empty checks, and connect this to queue and stack patterns.
Learn to implement a stack using queues, using only standard queue operations to achieve LIFO, with push, pop, top, and empty, plus a deck-based Python simulation.
Understand stack operations and queue behavior by implementing push as append, popping with queue-like pop left, and peeking the last element with top, ensuring correct empty checks.
Tackle the baseball game scorekeeping problem using a stack-like method to process inputs such as integers, plus, D, and C, and compute the final total by the rules.
Apply a stack-based approach to process a sequence of operations, using C to eliminate, D to double the previous one, and plus to sum the previous two scores, appending integers.
Solve the daily temperatures problem, a medium question, by computing for each day how many days until a warmer temperature appears, using the index difference as the output.
Learn to solve the daily temperatures problem using a monotonic decreasing stack, storing temperature and index, to achieve O(n) time and O(n) space with a preinitialized zeros result array.
Implement and understand linked lists through hands-on practice, learn what a linked list is, and tackle interview questions, while linking trees and graphs as related forms.
We examine what a linked list is, contrast it with arrays and lists, learn about nodes, head and tail, and discuss insertion and access for interview problems.
Explore the doubly linked list concept, compare it with a singly linked list, and implement nodes with value, next, and previous in Python using a Jupyter notebook.
Explore big O comparisons between singly linked lists and arrays, focusing on append, pop, access, and insert operations and when head or tail actions are constant versus linear.
Remove the nth node from the end of a singly linked list and return the remaining nodes as an array.
Learn to remove the nth node from the end of a singly linked list using two pointers, achieving O(n) time and O(1) space.
Solve the intersection of two linked lists by finding the first intersecting node. Return that node or null if they do not intersect, and practice in a realistic interview setting.
Use the two-pointer method to find the intersection of two linked lists; move pointers across both lists, wrap to the other head, achieving linear time with constant space.
Solve the duplicate number problem in an array of n+1 integers in the range 1 to n, without modifying the array and with constant space, contrasting naive n^2 time.
Explore trees and recursion by building and analyzing binary search trees. Understand roots, parents, and children, and learn how left and right pointers enable efficient search.
Explore big o notation in binary search trees, distinguishing worst-case linear time from balanced tree logarithmic time. Learn how depth and unbalanced structures affect search, insert, and delete operations.
Implement a custom binary search tree in Python, define a node with left and right pointers, and build an insert method that places values, handles an empty root, and duplicates.
Implement the contains method in the binary search tree, using left and right traversal to locate values, and compute minimum and maximum, prepping for recursion and traversal topics.
Explore recursion as a powerful technique by writing self-referential functions with clear exit conditions, illustrated with factorial and sum in Python, including edge cases.
Explore how to reverse an array of characters in place using recursion. Practice constant-memory reversal without creating extra data structures, preparing you for data structures and algorithms interviews.
Explore computing Fibonacci numbers using recursion, where each term equals the sum of the two preceding numbers, with base cases and guidance to solve the problem on your own.
Explore the fibonacci sequence with recursion and iteration, compare their use, and cover exit conditions, edge cases, a two-pointer iterative approach, and memorization for dynamic programming.
Invert a binary tree by swapping left and right children at every node and return the root, demonstrating horizontal inversion and introducing recursion with upcoming dfs and bfs techniques.
Explore tree traversal algorithms with depth-first search and breadth-first search, learn their implementations, and apply them to solve related interview questions.
Explore breadth-first and depth-first search techniques for tree traversal, comparing horizontal versus vertical traversal, and learn how to apply DFS and BFS to interview problems and graphs.
Implement breadth-first search on a binary tree using a queue to traverse nodes in first-in, first-out order and collect values. Apply the breadth-first search approach to a binary search tree.
Master depth-first search with preorder, postorder, and inorder traversals. Compare three code variations that share the same logic, implemented via a recursive traverse that visits left then right.
Explore dfs methods, focusing on post-order and in-order traversals and how the traverse function handles left and right children, including when to append values.
Convert a binary search tree to a greater tree by summing all keys greater than each node and adding the sum to that node, via a traversal.
Explore the binary tree maximum path sum, a hard problem solved with dfs, finding the greatest connected path, not necessarily through the root, including single-node cases such as 42.
Implement a graph using an adjacency list in a Python class, with methods to add vertices and edges, remove edges and vertices, and a print function to display connections.
Solve the number of islands challenge by interpreting a 2d binary grid of ones and zeros as a graph, and count connected landmasses through a straightforward, medium-difficulty approach.
apply bfs to count islands in a binary grid by traversing a matrix of ones and zeros, using a visited set and a queue to mark connected components.
Explore the redundant connection problem in an undirected connected graph, remove the edge that creates a cycle to form a tree, and follow the input and expected outputs for validation.
Learn how union find solves redundant connection problems. Use union by rank and path compression to efficiently connect nodes, track parents, and detect cycles in graphs.
Explore search algorithms by comparing sequential search and binary search in arrays. Learn how hash tables enable fast lookups and how two pointers implement binary search for logarithmic time.
Implement sequential search for unordered and ordered lists, and binary search for an ordered list, in Python via a Jupyter notebook, with class methods and practical tests.
Explore hash tables to achieve constant time lookups with a hash function. See how chaining and linear probing handle collisions, and how dictionaries map keys to values.
Build a hash table in Python to store key-value pairs by mapping a key to an index with a hash function, using prime multipliers and collision handling.
Learn to solve the two sum problem by finding two numbers in an array that add to a target and return their indices using hash tables.
Learn a hash map solution to the two-sum problem: find two numbers that add to the target in linear time with a dictionary, trading space for speed.
Explore encode and decode for a tiny url service, using hash tables to map long urls to short codes, with two inverse functions that encode and decode.
Encode long URLs into short ones using two hash maps to map long to short and short to long, with a base URL and incremental suffixes.
Explore the brick wall problem by counting gaps between bricks using a hash map, identify the maximized gap, and compute the minimum breaks from wall length.
Explore sorting algorithms and the heap data structure, implement each sorting method ourselves, and study heap sort while solving related interview questions for a solid foundation in data structures.
Explore sorting algorithms, including bubble sort, merge sort, and heap sort, and implement them for interview problems. Visualize concepts with Visualgo and build a sorting class in a Jupyter notebook.
Bubble sort demonstrates comparing adjacent values and pushing the larger ones to the right, using nested for loops, visualized as an animation, and runs in O(n^2) time.
Learn how selection sort finds the minimum element, swaps it to the front, and uses nested loops with a min index to sort the array, contrasting with bubble sort.
Master merge sort by dividing the array to single elements, then merging sorted halves with two pointers to achieve log n time complexity and efficient sorting.
Explore the quicksort algorithm by using the first element as pivot, partitioning around it, swapping to place the pivot, with average n log n time and possible quadratic worst case.
Explore the quicksort algorithm by detailing the pivot, end index, swap index, and how to partition with swaps. Discuss performance, noting logarithmic time and worst-case quadratic time for sorted inputs.
Explore the heap data structure, visualize heap forms, see how insertion maintains balance, convert to an array, apply heapify, and learn max and min heaps and heap sort.
Learn how heap sort uses a max heap to push the largest element to the end of the array, performing heapify and swaps to sort in O(n log n) time.
Identify the k closest points to the origin by comparing distances from (0,0) using coordinates, and implement with a heap (optional) for efficient selection.
Use a min heap to find the k closest points to origin by computing distances with x^2 + y^2, then heapify and pop the minimum k times to return coordinates.
Discover a median finder using two heaps—a max heap for the lower half and a mean heap for the upper half—to achieve logarithmic inserts and constant-time median.
Welcome to the Complete Data Structure & Algorithms: Technical Interviews course
Data structures and algorithms is not just a subject which every programmer should master but also a major topic in technical interviews by giant technology companies such as Google, Amazon, Microsoft, Netflix, Uber, Tesla etc.
Not only we will learn about the theory and practical implementations of the data structures & algorithms but also we will solve many technical interview questions and practice what we learn in each section.
During the course we will use Python programming language for all implementations and question solutions. However if you are sufficient in any other programming language before, you would be fine. We have a quick Python Refresher section where you can learn about the fundamentals if you want to adapt. Alternatively you can learn all the algorithms and solutions and implement them in your own preferred language as well.
This course is brought to you by Atil Samancioglu, teaching more than 300.000 students worldwide on programming and cyber security along with the Codestars, serving more than 1 million students! Atil also teaches mobile application development in Bogazici University and he is founder of his own training startup Academy Club.
Some of the topics that will be covered during the course:
Technical Interview Questions
Big O Notation
Stack
Queue
Deque
Arrays
Linked List
Heap
Graph
Tree
HashTable
After you complete the course you will be able to solve technical interview questions, improve your programming skills and implement ideas in real life problems. You will be given many opportunities to solve questions on your own during the training and it will be vital for you to follow these instructions.
If you are ready, let's get started!