Skip to main content

diff_greedy

Function diff_greedy 

Source
pub fn diff_greedy(r: &[u8], v: &[u8], opts: &DiffOptions) -> Vec<Command>
Expand description

Greedy algorithm (Section 3.1, Figure 2).

Finds an optimal delta encoding under the simple cost measure (optimality proof: Section 3.3, Theorem 1). Uses a chained hash table (HashMap) or splay tree storing ALL offsets in R per fingerprint. Time: O(|V| * |R|) worst case. Space: O(|R|).