@tyriar/fibonacci-heap
Advanced tools
Comparing version 2.0.6 to 2.0.7
{ | ||
"name": "@tyriar/fibonacci-heap", | ||
"version": "2.0.6", | ||
"version": "2.0.7", | ||
"description": "An implementation of the Fibonacci heap data structure", | ||
@@ -5,0 +5,0 @@ "scripts": { |
@@ -8,6 +8,6 @@ /** | ||
import { Node } from './node'; | ||
import { IKeyComparable } from './interfaces'; | ||
import { INode } from './interfaces'; | ||
import { NodeListIterator } from './nodeListIterator'; | ||
export type CompareFunction<K> = (a: IKeyComparable<K>, b: IKeyComparable<K>) => number; | ||
export type CompareFunction<K, V> = (a: INode<K, V>, b: INode<K, V>) => number; | ||
@@ -19,3 +19,3 @@ export class FibonacciHeap<K, V> { | ||
constructor( | ||
private _compare?: CompareFunction<K> | ||
private _compare?: CompareFunction<K, V> | ||
) { | ||
@@ -163,3 +163,3 @@ if (!_compare) { | ||
*/ | ||
private _defaultCompare(a: IKeyComparable<K>, b: IKeyComparable<K>): number { | ||
private _defaultCompare(a: INode<K, V>, b: INode<K, V>): number { | ||
if (a.key > b.key) { | ||
@@ -166,0 +166,0 @@ return 1; |
@@ -7,9 +7,5 @@ /** | ||
export interface IKeyComparable<K> { | ||
key: K; | ||
} | ||
export interface INode<K, V> { | ||
key: K; | ||
value: V; | ||
value?: V; | ||
} |
@@ -7,5 +7,5 @@ /** | ||
import { IKeyComparable, INode } from './interfaces'; | ||
import { INode } from './interfaces'; | ||
export class Node<K, V> implements INode<K, V>, IKeyComparable<K> { | ||
export class Node<K, V> implements INode<K, V> { | ||
public key: K; | ||
@@ -12,0 +12,0 @@ public value: V; |
@@ -7,3 +7,3 @@ /** | ||
import { IKeyComparable, INode } from "../src/interfaces"; | ||
import { INode } from "../src/interfaces"; | ||
import { CompareFunction } from "../src/fibonacciHeap"; | ||
@@ -20,3 +20,3 @@ | ||
*/ | ||
constructor(compare?: CompareFunction<K>); | ||
constructor(compare?: CompareFunction<K, V>); | ||
@@ -23,0 +23,0 @@ /** |
Sorry, the diff of this file is not supported yet
37731
784