Swift: Merge Sort Algorithm (iOS Interview Prep) 2022
Vložit
- čas přidán 27. 08. 2024
- In this video we will learn how to implement the popular sorting algorithm known as Merge Sort. Popular in interview questions, merge sort is based on the concept of divide and conquer. We will split input arrays by two and re-build merged sorted arrays for the final result. We will walk through the algorithm together and implement it in Swift 5 and Xcode 13.
💻 Source Code: / iosacademy
🎥 Subscribe for more: www.youtube.co...
😎 Like my teaching style? Check out some of my most popular courses! courses.iosaca...
** Popular Series
Building Instagram: courses.iosaca...
Building TikTok: / @iosacademy
SwiftUI for Beginners: ios-academy.te...
** Get Skillshare free for 2 Months and learn iOS
www.skillshare...
** Manage all your investments from app earnings on Betterment!
bit.ly/3eBwlI9
** Grow your own CZcams tech channel with TubeBuddy:
www.tubebuddy....
#swift #algorithms #mergeSort
Don't stop making swift Algorithm , Full Support :)
Thanks!
@@iOSAcademy yes. Don’t stop it please. 💪
Without any bull shit, every second in this video is informative. This is how an informative video should be. Keep up the great work. 👍
Great stuff. Thank you for all your videos. Keep up the great work
Thanks
Please make more videos on swift logical thing
Coming soon!
I'm pleasure you are making swift algorithm! thanks!
My pleasure!
thx for video!
Nice to look at that
Thanks
I love your content bro
Thank you!
I hope this will be a new series
Yes!
Great content bro
Thanks!
Please make more 😍
Coming soon!
Will interview prep all be on the YT channel, or will plus members get content too?
YT will have some content. Plus members will get all premium content & coding questions
@@iOSAcademy Sweet. Since a lot of iOS interviews have leetcode rounds, there’s definitely plenty of content you can make, like Data Structures and Algorithms in Swift (very few resources for this), as well as solving leetcode questions in a Swifty way 🤓
You probably forgot to mention the time/space
Yep, disnt want it to get too confusing
@@iOSAcademy Hi) Thanks for great video! But it would be really convenient to watch one video with algorithms and with theirs complexities
Awesome 👏
Thank you!!
Thank you for the video ! I would like to ask you, could you give me directions how to set up a basic CRUD application ( books and other material ) ? Also, could a timer that fires every second be implemented in terminal window ( such as a real time clock ) without the buttons of UI ? I have the code from another source, but I’m missing something to make it work in the terminal :/
Hi Sir,
Is there any video available for multiple schemas in xcode ( within one source code how to maintain more than clients projects/app - white label application I can say)
It will change app name, launch screen, app logo and some content and alert messages based on schema selection while building/running project.
Wow 🤩
Haha thanks!
How much time do you lose or gain by using this method as opposed to just .sort() on the array?
The goal of this exercise is to create the mechanics of what .sort() does. It's probable that apple uses this algorithm, or similar, in Swift for the .sort() function.
🙏 thanks
Youre welcome
@@iOSAcademy if possible show us roadmap from beginner to advance..
What kind of things should i know if im ready for mid-senior role
class Program {
func mergeSort(_ array: [Int]) -> [Int] {
guard array.count > 1 else {
return array
}
let midIndex = array.count / 2
var leftArray = mergeSort(Array(array[0.. rightElement {
result.append(rightElement)
rightIndex += 1
} else {
result.append(leftElement)
leftIndex += 1
result.append(rightElement)
rightIndex += 1
}
}
while leftIndex < leftArray.count {
result.append(leftArray[leftIndex])
leftIndex += 1
}
while rightIndex < rightArray.count {
result.append(rightArray[rightIndex])
rightIndex += 1
}
return result
}
}
let program = Program()
let sortedArray = program.mergeSort([7,2,3,4,5,5,6,7,8,9,0,3,4,5,6,7])
print(sortedArray)