Different searching techniques with Objective-C.
iOS 9.0+ / macOS 10.10+ / tvOS 9.0+ / watchOS 2.0+
CocoaPods is a dependency manager for Cocoa projects. You can install it with the following command:
$ gem install cocoapods
To integrate SearchingTechniques into your Xcode project using CocoaPods, specify it in your Podfile:
source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '9.0'
use_frameworks!
target '<Your Target Name>' do
pod 'SearchingTechniques', '~> 0.4'
end
Then, run the following command:
$ pod install
Carthage is a decentralized dependency manager that builds your dependencies and provides you with binary frameworks.
You can install Carthage with Homebrew using the following command:
brew update
brew install carthage
To integrate SearchingTechniques into your Xcode project using Carthage, specify it in your Cartfile:
github "abdullahselek/searching-techniques" ~> 0.4
Run carthage update to build the framework and drag the built SearchingTechniques.framework into your Xcode project.
STLinearSearch *linearSearch = [[STLinearSearch alloc] initWithDataSet:@[@"1", @"2", @"3", @"5", @"6", @"7"]];
int index = [linearSearch search:@"2"];
STBinarySearch *binarySearch = [[STBinarySearch alloc] initWithDataSet:@[@10, @8, @3, @4, @5, @6, @9, @7];
int index = [binarySearch search:@5];
STInterpolationSearch *interpolationSearch = [[STInterpolationSearch alloc] initWithDataSet:@[@10, @8, @3, @4, @5, @6, @9, @7]];
int index = [interpolationSearch search:5];