|Number of watchers on Github||364|
|Number of open issues||5|
|Average time to close an issue||8 days|
|Average time to merge a PR||about 2 years|
|Open pull requests||1+|
|Closed pull requests||4+|
|Last commit||over 5 years ago|
|Repo Created||over 9 years ago|
|Repo Last Updated||over 2 years ago|
|Organization / Author||quinntaylor|
|Do you use CHDataStructures? Leave a review!|
|View open issues (5)|
|View CHDataStructures activity|
|View on github|
|Book a Mock Interview With Me (Silicon Valley Engineering Leader, 100s of interviews conducted)|
Software engineers: It's time to get promoted. Starting NOW! Subscribe to my mailing list and I will equip you with tools, tips and actionable advice to grow in your career.
<!DOCTYPE html PUBLIC
-//W3C//DTD XHTML 1.0 Transitional//EN
CHDataStructures is a library of standard data structures which can be used in (virtually) any Objective-C program. Data structures in this library adopt Objective-C protocols that define the functionality of and API for interacting with any implementation thereof, regardless of its internals.
This library provides Objective-C implementations of common data structures which are currently beyond the purview of Apple's extensive and flexible Cocoa frameworks. Collections that are a part of Cocoa are highly optimized and amenable to many situations. However, sometimes an honest-to-goodness stack, queue, linked list, tree, etc. can greatly improve the clarity and comprehensibility of code. The currently supported abstract data types include: deque, heap, linked list, queue, stack, and tree.
The code is written against Apple's Foundation framework and uses some features of Objective-C 2.0 (present in OS X 10.5+ and iOS) when possible. Most of the code could be easily ported to other Objective-C environments (such as GNUStep) but such efforts would be better accomplished by forking this project rather than integrating with it, for several main reasons:
While certain implementations utilize straight C for their internals, this framework is fairly high-level, and uses composition rather than inheritance in most cases. The framework began its existence as an exercise in writing Objective-C code and consisted mainly of ported Java code. In later revisions, performance has gained greater emphasis, but the primary motivation is to provide friendly, intuitive Objective-C interfaces for data structures, not to maximize speed at any cost (a common outcome when using C++ and the STL). The algorithms should all be sound (i.e., you won't get O(n) performance when it should be O(log n) or O(1), etc.) and perform quite well in general. If your choice of data structure type and implementation are dependent on performance or memory usage, it would be wise to run the benchmarks from Xcode and choose based on the time and memory complexity for specific implementations.
All source code and resources for the framework are freely available at this link. They are organized in an Xcode 3 project with all relevant dependencies.
If you only need a few of the classes in the framework, you can cut down on code size by either excluding parts you don't need from the framework, or just including the source you do need in your own code. Please don't forget to include relevant copyright and license information if you choose to do so!
The original page for the framework when it was maintained by Phillip Morelock (back when its name was "Cocoa Data Structures Framework") is here.
CHDataStructures builds for both OS X (as a framework) and iOS (as a static library, since third-party frameworks are not permitted). The following directions assume that you have either built the appropriate library form (framework or static library) from source, or are using a binary distribution. (When building from source, compile the All target in the Release configuration, which produces a disk image containing the binaries.)
NOTE: When using this library, if you get a "Declaration does not declare anything" compiler warning, set the "C Language Dialect" (
GCC_C_LANGUAGE_STANDARD) setting in your target's build settings to
CHDataStructures.frameworkto your project by dragging it to the "Groups & Files" pane.
Contents/Frameworks/directory in your application bundle. (The executable path in the framework binary expects this location.)
#import <CHDataStructures/CHDataStructures.h>where necessary in your code.
For details or clarification about frameworks, consult the Framework Programming Guide.
libCHDataStructures.aand the library header files to your project by dragging them to the "Groups & Files" pane. (You can organize the headers in their own physical directory and sidebar group to prevent clutter.)
libCHDataStructures.ainto the "Link Binary With Libraries" build phase.
#import "CHDataStructures.h"where necessary in your code.
If you have any issues with this approach, you can opt to drag
CHDataStructures-iOS.xcodeproj into the "Groups & Files" pane and use the
libCHDataStructures.a product from that project. In this case, you must also include
PATH_TO_CHDATASTRUCTURES/source in Header Search Paths (
HEADER_SEARCH_PATHS) for your target.
Documentation is auto-generated after each Subversion commit, and is available online. You can also generate it yourself from the main Xcode project by building the "Documentation" target (if Doxygen is installed and its executable is in your Unix
Let's just say it: no software is perfect. It would be foolish (and a lie) to claim that this framework is flawless, or even complete. There are several things that could be improved, and admitting you have a problem is the first step.... Accordingly, the online documentation includes lists of known bugs and wish list items that are documented in the code.
Please know that it is not my intent to leave the hard things "as an exercise to the reader." (Believe me, writing a generic, iterative, state-saving tree traversal enumerator was no walk in the park!) However, I would love to draw on the talents of others who can provide solutions which currently evade me, or which I haven't had time to implement yet. If you have ideas (or even better, a fix) for one of these items, email me and we'll talk. Thanks!
This framework is released under a variant of the ISC license, an extremely simple and permissive free software license (functionally equivalent to the MIT license and two-clause BSD license) approved by the Open Source Initiative (OSI) and recognized as GPL-compatible by the GNU Project. The license is included in every source file, and is reproduced in its entirety here:
Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies.
The software is provided "as is", without warranty of any kind, including all implied warranties of merchantability and fitness. In no event shall the authors or copyright holders be liable for any claim, damages, or other liability, whether in an action of contract, tort, or otherwise, arising from, out of, or in connection with the software or the use or other dealings in the software.
Earlier versions of this framework were released under a copyleft license, which are generally unfriendly towards commercial software development.
This README file is also considered a source file, and you must include it if you redistribute the framework in source form. If you change the framework, you should add your own README and include it with the source, describing your changes. If you contribute source code to the framework, you may keep your copyright or assign it to me, but you must agree to license the code under this license.
All contributions (including bug reports and fixes, optimizations, new data structures, etc.) are welcomed and encouraged. In keeping with this project's goals, new features are subject to consideration prior to approval—there are no guarantees of adoption. Modifications that are deemed beneficial to the community as a whole will fit with the vision of this project and improve it. However, not all potential contributions make sense to add to the framework. For example, additions or enhancements that only apply for a specific project would be more appropriate to add as categories or subclasses in that code.
Email me if you're interested in contributing to the project, discussing improvements or additions you'd like to see, or even just letting me know that you're getting some use from it.
Major contributors are listed below, alphabetically by last name:
.xcodeprojformat, organization of project resources, use of Objective-C 2.0 features.