Skip to content

Commit

Permalink
Updates README.md with rationale.
Browse files Browse the repository at this point in the history
  • Loading branch information
kzaher committed Feb 5, 2017
1 parent 896bced commit bca9343
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,12 @@ Observable.just([SectionModel(model: "title", items: [1, 2, 3])])
```
![RxDataSources example app](https://raw.githubusercontent.com/kzaher/rxswiftcontent/rxdatasources/RxDataSources.gif)

## Why was custom diff algorithm used?

- All dynamic programming diff solutions (longest common subsequence problem) have worst quardratic time complexity O(n^2). If you are interested in exploring those solutions, we recommend [Diff](https://github.com/wokalski/Diff.swift#diffswift).
- It's even more problematic to reconcile tree edit distance algorithms with `UI{Table,Collection}View` animated section updates.
- In all practial cases each section item is uniquely identified and that can be used to optimize the algorithm.

## How
Given the following custom data structure:
```swift
Expand Down

0 comments on commit bca9343

Please sign in to comment.