Viewing: Swift

Selection Sort

Selection Sort algorithm does the same amount of comparison( N*(N-1)/2 ) like bubble sort but the number swaps (N) is reduced drastically. This sort algorithm traverse through all the items, picks the smallest number and swaps it with left most item. Then the step is repeated for the next smallest number until it reaches the […] Read More

Binary search

After a simple bubble sort algorithm (not the most efficient sorting algorithm), let us try to implement Binary search in Swift Programming Language. Binary search algorithm can be applied only on sorted arrays. So let us first generate random numbers and store them in an array. Then call the bubble sort function to sort the […] Read More

Bubble Sort

The best way to practice a new language is to write more programs using that language. Here is a Bubble Sort program written in Swift Programming language. Data to be sorted = {12, 56, 32, 23, 67, 87, 45, 23,10, 11} Bubble Sort Bubble Sort is performed by comparing two number starting from the left […] Read More

Decode job advert posted in Swift Language

I came across this unique Swift job advert in posted by Criteo. (Need to add override for the init function, missed in the original job post) var hello = "Hello, I am a Swift Program, paste me in the playground" var doyouswift = "You think you have what it takes to build the next […] Read More

1 2 3