Skip to main content

All Questions

Filter by
Sorted by
Tagged with
1 vote
1 answer
66 views

Comparing two general LCA algorithms in Java

Now I have two algorithms solving a problem: given a general (multi-way) tree, and any array of node names, find the the node that is the deepest common ancestor. ...
coderodde's user avatar
  • 29.8k
1 vote
1 answer
215 views

Comparing a prefix tree against a HashSet of strings in Java

Here, I have made an attempt to find out whether a prefix tree is any more efficient than a simple java.util.HashSet<String>. See what I have: ...
coderodde's user avatar
  • 29.8k
7 votes
4 answers
147 views

Find the 1st and 2nd largest num in an array, O(log N) + O(N) version

I have implemented the \$O(logN) + O(N)\$ version for the problem: How to find 1st and 2nd largest element in a non-negative unique array? The algorithm principle is from this stackoverflow answer.The ...
very hit's user avatar
  • 171