Skip to content

santigz/Swift-data-structures

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

69 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Swift data structures

I could not find a good Swift implementation of some essential data structures, so I made them. Hope this saves you some time.

Data structures:

A note on linked lists

TL;DR: use (circular) arrays instead of linked lists unless you know what you’re doing.

You may often read the benefits of linked lists from a theoretical point of view, argued using Big-O performance. However, too frequently the locality of reference is not taken into account. Arrays are extremely optimised for traveling and copying, whereas linked lists are much slower for that matter. Even for large datasets, inserting a new element in the middle of the structure may be faster using an array (which requires copying the entire array) than using a linked list (which requires traveling it). However, in some specific cases, a linked list may be just the most performant structure to use.

About

A decent Swift implementation of some data structures

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published