Skip to content

Commit 4010a69

Browse files
committed
Add comment about the complexity of the build method
1 parent eab77ee commit 4010a69

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/data-structures/suffix-tree.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ SuffixTree.prototype.addNode = (function () {
5656
};
5757
}());
5858

59+
// O(n^2) or even O(n^3) because of maxPrefix
5960
SuffixTree.prototype.build = function (string) {
6061
this.root.value = string;
6162
for (var i = 1; i < string.length; i += 1) {

0 commit comments

Comments
 (0)