In a recent tutorial I described how to create a binary tree data structure and populate it with numerical data. Now, in this tutorial, I will explain how to search each level of the binary tree for a specific numeric value. As previously described in my past tutorial, search and sort operations on binary tree's is a very popular use case because of the efficiency in performing these operations. For a binary tree with n elements the time complexity in searching the tree is O(log(n)) in the worst case. W
Tree data structures are a fundamental data structure used in computer science. Tree's can be used for searching and sorting data hierarchies such as UIView's via tags and custom objects via leveling order. Binary tree's are also very similar in that they provide an efficient sorting mechanism to quickly search large amounts of data. A while back I was looking through some of my old Objective-C archives and found a binary tree implementation that was created but never seen the light of day on any project. To get some use out of this code and to share my binary tree implementation I t
Like the quicksort or the insertion sort algorithm, the mergesort algorithm is a fundamental sorting algorithm in computer science. A while back I was looking through my old Objective-C archives and found a mergesort implementation that was created but never had seen the light of day in any project. To get some use out of this code and to share this implementation with anyone looking for a mergesort algorithm I thought I would write a brief tutorial on how my implementation of mergesort works in Objective-C. First, before getting started, there are a few things to keep in mind about thi
The quicksort algorithm is a fundamental sorting algorithm in computer science. A while back I was looking through my old Objective-C archives and found a quicksort implementation that I had created that never seen the light of day in any project. To get some use out of this code and to share this implementation with anyone looking for a quicksort algorithm I thought I would write a brief tutorial on how my implementation of quicksort works in Objective-C. First, before we get started though there are a few things to keep in mind about this tutorial. The first is that this tutorial was
Over the years I have accumulated a lot of interesting code in my repositories from different research and side projects I’ve been involved with. A lot of this code is based in C, C++, and Objective-C, but ultimately has never see the light of day just because it was scrapped as part of a larger project or a feature being deprecated. Last week I was looking through my old Objective-C archives and realized that I have some pretty interesting examples of general computer science algorithms that I have never shared with my blog audience.
I have been developing a concept lately in which I thought I got all of the kinks worked out, but it looks like I am having some issues. Basically in my iOS application I have a model that holds all of the data for my application and in that model I have a UIModel that inherits from my model where I build out all of my UI elements that are to be used throughout my application in many different places.
I ran into a strange problem the other day while I was working. I was developing a iPad photo application that included the functionality of selecting photos from your camera roll and taking images from the device's camera. I first developed the functionality to pull up the camera, take a photo, and save it to a UIImageView in the ViewController, this worked great and I did not think anything was up. However, when I developed the functionality to pull up the camera roll and select a photo to assign to the UImageView, the app kept crashing with a strange error I'd never seen before.