Get Started with Algorithms and Data Structures in Swift 5
4.5 (188 ratings)
Course Ratings are calculated from individual students’ ratings and a variety of other signals, like age of rating and reliability, to ensure that they reflect course quality fairly and accurately.
1,407 students enrolled

Get Started with Algorithms and Data Structures in Swift 5

Lay the foundations of algorithms & data structures. Become a better programmer. A must-have for programming interviews!
4.5 (188 ratings)
Course Ratings are calculated from individual students’ ratings and a variety of other signals, like age of rating and reliability, to ensure that they reflect course quality fairly and accurately.
1,407 students enrolled
Created by Karoly Nyisztor
Last updated 12/2018
English
English
Current price: $11.99 Original price: $104.99 Discount: 89% off
3 days left at this price!
30-Day Money-Back Guarantee
This course includes
  • 2 hours on-demand video
  • 9 articles
  • Full lifetime access
  • Access on mobile and TV
  • Assignments
  • Certificate of Completion
Training 5 or more people?

Get your team access to Udemy's top 3,000+ courses anytime, anywhere.

Try Udemy for Business
What you'll learn
  • Learn how to write elegant and efficient code from a leading expert
  • Cut down on your development time

  • Get ready for technical job interviews

  • Gain a working knowledge of algorithmic thinking
  • Learn how to improve the performance of existing code
  • Understand the popular sorting algorithms and implement them from scratch
Course content
Expand all 57 lectures 02:02:55
+ Overview
5 lectures 07:09

Hi,
I’m Karoly Nyisztor and welcome to Introduction to Algorithms and Data Structures in Swift.

Preview 02:45

Let's check whether you've got all it takes to enjoy and benefit from this course.

Preview 01:06

Still undecided? Here's why you should learn about algorithms and data structures.

Preview 01:20

Here's what you need if you want to follow along with me.

Prerequisites
01:14

Link to the demo project and other useful resources.

Demo Projects and Other Useful Resources
00:44
+ Big O Notation
8 lectures 21:28

In this section we are going to talk about computational complexity. The Big-O notation is a mathematical model used in computer science to describe the efficiency of algorithms as a function of their input size. 

The best way to understand the Big-O thoroughly is via code examples. Therefore, we are going to illustrate each concept using live Swift coding.

Big O - Overview
02:35

In this lecture, we are going to talk about the Constant Time complexity. We'll also implement Swift functions that execute in constant time.

Preview 05:40

This lecture is about the Linear Time complexity. As usual, we'll not only talk about the theory, but we are going to also illustrate O(n) via Swift code examples.

Linear Time - O(n)
04:17

The topic of this lecture is the Quadratic Time complexity. We are going to delve into the world of nested loops and we'll discuss why they should be avoided if possible.

Quadratic Time - O(n2)
03:53

Do your best to avoid polynomial - and worse - time complexity. This lecture explains what to do if you encounter O(n^k).

Hints for O(n^k) Complexity
01:32

Let's take a closer look at the logarithmic time complexity. Logarithmic time represents an extremely efficient algorithm, used by the binary search technique for example.

Logarithmic Time - O(log n)
01:56


Understanding the Big-O notation paves the road to working with algorithms. This lecture is a brief summary of what we've learned during this module.

Summary
01:30

Big O Quizzes

Big O Quizzes
3 questions

Xcode playground projects for the Big-O section.

Big-O Source Code (Swift playground projects)
00:05
+ Recursion
6 lectures 12:41

An overview of what we're going to cover in the Recursion section.

Recursion - Overview
00:40

I'm going to show how what recursion is. We're going to analyze some examples and we'll even implement a recursive data structure.

What is Recursion?
02:43

In this video, I'm going to walk you through a demo to show you how recursion works. We're going to also solve an interesting problem.

How Does Recursion Work?
04:45

Recursion is great, but it doesn’t come without pitfalls. The biggest problem is infinite recursion. I’m going to illustrate it using an Xcode playground project.

Recursion Pitfalls
02:37

There are two basic rules we need to follow to avoid infinite recursion. Let's take a closer look at them.

How to Avoid Infinite Recursion?
01:51

Recursion Quizzes

Recursion Quizzes
4 questions

Recursion demos.

Recursion Source Code (Swift playground projects)
00:05
+ The Power of Algorithms
6 lectures 14:35

In this section, we are going to take a closer look at the importance and the benefits of algorithms and algorithmic thinking.

The Power of Algorithms - Overview
01:29

In this lecture, we are going to implement a function which calculates the sum of the first N natural numbers. We’ll start with a naive implementation. 
Then, we are going to implement a more efficient way to solve this problem using a formula that is more than 2000 years old.

Calculate Sum(N)
03:04

Our task is to implement a function that, given an array and a target value, returns zero-based indices of any two distinct elements whose sum is equal to the target sum.

Pair Matching Challenge
04:17

In this lecture, we are going to build a function to find the equilibrium indices of an array. The equilibrium index of an array is an index such that the sum of elements at lower indices is equal to the sum of elements at higher indices.

Find the Equilibrium Index
03:51

In this section, we’ve seen some practical examples of solving problems using two different approaches. Let's recap the biggest take-aways.

Summary
01:49

The Power of Algorithms - Xcode playground projects.

The Power of Algorithms - Source Code (Swift playground projects)
00:05
+ Working with Generics
5 lectures 08:07

This is what we're going to talk about in this section.

Generics - Overview
00:55

In this video, we'll try to solve a problem using a naive approach. We'll see where this leads and why generics are the way to go.

Why Generics?
01:24

Generic structures provide an elegant solution to the problem presented in the previous lecture. Here's how.

Generic Types
01:56

Generic functions can work with any type. In this lecture, I'll show you how to avoid code repetition. We'll also talk about generic functions and type constraints.

Generic Functions
03:47

Let's test your knowledge about Swift Generics!

Generics Quizzes
3 questions

Xcode playground projects for the Generics section.

Generics Sample Code (Swift playground project)
00:05
+ The Built-In Swift Collection Types
11 lectures 21:13
Swift Collection Types - Overview
00:55
The Array
02:08
Accessing the Array
01:09
Modifying the Array
02:43

We’ve seen that the array stores elements in a given order. We can even have duplicates in an array.
What if we need a collection that guarantees the uniqueness of its elements? The Set is the answer!

The Set
02:27

Now that we know how to create a Set, let’s talk about accessing and modifying its contents.

Accessing and Modifying the Set
01:48

The Set exposes useful methods that let us perform fundamental set operations.

Set Operations
01:10

There will be cases when you need to adopt the Hashable protocol.
For example, if you want to create a Set with your custom type, or use it as a key in a Dictionary, you can't avoid conforming to Hashable.

The Hashable Protocol
04:40

The Dictionary, also known as hash-map, stores key-value pairs. In this lecture, we're going to talk about topics like dictionary creation, heterogeneous dictionaries, the AnyHashable protocol and much more.

The Dictionary
02:33

The Dictionary provides various methods to access and modify its contents. This video takes a closer look at these methods.

Accessing and Modifying the Dictionary
01:35

Test your knowledge about the Array, the Set and the Dictionary

Swift Collection Types Quizzes
9 questions

Xcode playground projects for the "Built-In Swift Collection Types" section.

Built-in Swift Collection Types - Demos (Swift playground projects)
00:05
+ Basic Sorting
8 lectures 23:51

In this section we are going to talk about basic sorting algorithms.
Understanding the inner workings and knowing how to implement the basic sorting algorithms gives you a strong foundation to building other, more sophisticated algorithms.

Basic Sorting - Overview
02:17

We'll start the study of basic sorting algorithms with the selection sort algorithm. We are going to implement it in Swift. We’ll also visualize how selection sort works and we’ll analyze the time complexity of this algorithm.
Finally,we are going back up the theory with performance tests.


Selection Sort
05:33

Let's quickly recap the pros and cons of the selection sort algorithm.

Selection Sort Summary
00:49

Insertion sort is a basic sorting algorithm, which works by analyzing each element and inserting it into its proper place, while larger elements move one position to the right. 

Insertion sort has quadratic time complexity. However, the performance of the insertion sort is largely affected by the initial order of the elements in the sequence.

Insertion Sort
07:58

In the previous lecture, we took a closer look at the insertion sort algorithm. Did you know that even Apple uses it in their sort() implementation? Check out why!

Insertion Sort - Summary
01:03

The topic of this lecture is Bubble Sort. This algorithm works by repeatedly evaluating adjacent items and swapping their position if they are in the wrong order. While it's easy to grasp and implement, you don't want to use it in production code. Let's see why!

Bubble Sort
05:05

A brief summary of the bubble sort algorithm.

Bubble Sort - Summary
01:01

Test your knowledge on basic sorting algorithms.

Basic Sorting Quizzes
4 questions

Xcode playground projects for the Basic Sorting section.

Basic Sorting Demos (Swift playground project)
00:05
+ Advanced Sorting
6 lectures 10:04

A brief overview of what to expect in this section.

Advanced Sorting - Overview
00:53

The merge sort is a fast divide-an-conquer algorithm. Check out this lecture to see what that means.

Merge Sort
03:46

Merge sort in a nutshell.

Merge Sort - Summary
00:55

In this lecture, we'll analyze the famous quicksort - the king of the compare-based sorting algorithms.

Quicksort
03:28

Let's recap what we've learned about the popular - and fast - quicksort algorithm.

Quicksort - Summary
00:57

Quizzes for the Advanced Sorting Algorithms section.

Advanced Sorting Quizzes
3 questions

Xcode playground projects for the Advanced Sorting section.

Advanced Sorting Source Code (Swift playground projects)
00:05
+ Where Do You Go From Here?
2 lectures 04:10

Let me give you some useful online resources which will help you in sharpening your coding and problem solving skills.

Final Thoughts
02:32

I share some links that will get you discounts on my other courses.

BONUS: Huge Discounts on My other Courses & Useful Links
01:38
+ Test Your Skills
0 lectures 00:00
The stack is a collection of objects that are added and removed according to the last-in, first-out (LIFO) principle. New elements are added to the top of the Stack. You may only access or remove the most recently inserted object.
Implement an Array-Based Stack
1 question
Implement the Fizz Buzz algorithm in Swift.
Fizz Buzz
1 question
Requirements
  • Basic programming knowledge (variables, loops, functions). This course is beginner-friendly. Prior programming experience may be helpful, but you need not have actually worked with Swift itself.
Description

Take a closer look at algorithms and data structures and learn how to work with them to more efficiently approach software development with Swift. "Introduction to Algorithms and Data Structures in Swift 5" is a straightforward guide to solving coding problems more efficiently. 

In this comprehensive course, author Károly Nyisztor helps to familiarize yourself with algorithmic thinking and code optimization techniques. He explains each concept using easy-to-understand examples. He focuses on the practical application, using hands-on Swift code examples you can use for reference and practice. 

Throughout the course, Károly walks you through several demo applications to demonstrate the power of algorithms and the importance of picking the right solution.

Topics include:

  • Algorithmic thinking

  • The Big O notation

  • Constant, linear, polynomial and logarithmic time complexity

  • Understanding recursion and avoiding pitfalls

  • Case studies for finding faster solutions

  • Generics

  • Built-in Swift collection types

  • When to use a Set, an Array or a Dictionary?

  • Implementing selection sort, insertion sort, and bubble sort

  • Advanced sorting: quicksort and merge sort

The study of algorithms and data structures is fundamental to any programmer who plans to develop software systems that are scalable and performant. 
"Introduction to Algorithms and Data Structures in Swift 5" is the perfect course for you if you're interested in bringing your Swift coding skills to the next level.


Student reviews

"LOVE this instructor! His explanations are always clear and accurate, and his pacing is spot-on. Fantastic!" - Glenn

"Speed is very good for the content being taught. The size of the videos is perfect for the depth of the topic being discussed." - Nick Perkins

"Excellent clear presentation and covering the topic very well - recommended course!" - Graham Wright

"Very well made and in-depth explanations. Easy to follow and a lot of visual references making it very easy to understand! Great course overall and highly recommended." - Peter West

"This course gives me a much deeper understanding of how to write efficient and effective Swift code. It addresses things not covered in the various other crash courses on iOS development, things not apparent at first. I'd published several simple apps and games already but discovered I needed this information when I started working on a much more complex app and needed to understand how to improve my app's performance, so I searched for information on that and discovered this very helpful course." - Minni K. Ang

About the Author

Károly Nyisztor is a veteran mobile developer and instructor.

He has built several successful iOS apps and games—most of which were featured by Apple—and is the founder at LEAKKA, a software development, and tech consulting company. He's worked with companies such as Apple, Siemens, SAP, and Zen Studios.

Currently, he spends most of his days as a professional software engineer and IT architect. In addition, he teaches object-oriented software design, iOS, Swift, Objective-C, and UML. As an instructor, his aim is to share his 20+ years of software development expertise and change the lives of students throughout the world. He's passionate about helping people reveal hidden talents, and guide them into the world of startups and programming.

You can find his courses and books on all major platforms including Amazon, Lynda, LinkedIn Learning, Pluralsight, Udemy, and iTunes.


You’ll Get Premium Support 

As a student of this course, you’ll get personalized attention and support.


Our 30-day 100% money-back guarantee

If you aren't satisfied with your purchase, we'll refund you your money - no questions asked! We want to make sure you're completely satisfied with the course. That's why we're happy to offer you this money-back guarantee.


Go ahead and click the enroll button. See you in the first lesson!

Who this course is for:
  • Who wants to implement better, more performant software applications
  • Who wants to learn how to implement sorting algorithms from basic to advanced
  • Who's interested in clean, modern Swift
  • Who wants to successfully pass technical interviews