abdullahselek / searching-techniques

Different searching techniques with Objective-C.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Build Status CocoaPods Compatible Carthage Compatible Coverage Status

searching-techniques

Different searching techniques with Objective-C.

Requirements

iOS 9.0+ / macOS 10.10+ / tvOS 9.0+ / watchOS 2.0+

Installation

CocoaPods

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

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.

Example Usage

Linear Search

STLinearSearch *linearSearch = [[STLinearSearch alloc] initWithDataSet:@[@"1", @"2", @"3", @"5", @"6", @"7"]];
int index = [linearSearch search:@"2"];

Binary Search

STBinarySearch *binarySearch = [[STBinarySearch alloc] initWithDataSet:@[@10, @8, @3, @4, @5, @6, @9, @7];
int index = [binarySearch search:@5];

Interpolation Search

STInterpolationSearch *interpolationSearch = [[STInterpolationSearch alloc] initWithDataSet:@[@10, @8, @3, @4, @5, @6, @9, @7]];
int index = [interpolationSearch search:5];

About

Different searching techniques with Objective-C.

License:MIT License


Languages

Language:Objective-C 91.0%Language:Ruby 9.0%