Questions tagged [java]
Java (not to be confused with JavaScript) is a class-based, object-oriented, strongly typed, reflective language and run-time environment (JRE). Java programs are compiled to bytecode and run in a virtual machine (JVM) enabling a "write once, run anywhere" (WORA) methodology.
10,934 questions
3
votes
2
answers
176
views
firstNonNull implementations
Between the two implementations, which one is better?
...
0
votes
0
answers
43
views
Reading CPU's Time Stamp Counter in Java (Windows JNI)
This time I present a small method for reading the CPU's TSC under Windows. The repo is here.
Code
io.github.coderodde.cpu.util.RDTSC.java:
...
1
vote
1
answer
70
views
Solving maximum network flow problem in Java: Edmonds Karp algorithm vs. Relabel-to-front
Intro
This time, I present two maximum flow algorithms:
Edmonds Karp algorithm,
Relabel-to-front.
(The entire repository with unit tests and more may be found here.)
Code
...
1
vote
1
answer
78
views
LoanChainSimplifier.java: Loan cycles simplification in financial graphs
The whole repository is here.
You can read about what is happening in my blog post.
Above, on the first row we show how to possibly resolve loan cycles. On the second row, one can see how to "...
4
votes
1
answer
181
views
Comparing integral element determinant algorithms: Laplacian expansion vs. Bareiss algorithm
Since Gaussian elimination breaks on matrices with integral element type, I changed it to Bareiss' algorithm which runs - just like Gaussian elimination - in \$\Theta(n^3)\$.
Code
...
3
votes
2
answers
236
views
Comparing determinant algorithms: Laplacian expansion vs. Gaussian elimination in Java
This post presents two algorithms for computing determinants in square matrices. My code follows.
Code
io.github.coderodde.determinant.LongSquareMatrix.java:
...
1
vote
1
answer
61
views
Comparing Hopcroft's and Moore's DFA minimization algorithms in Java
Prior attempts
This post extends my previous topic:
Deterministic finite automaton in Java
Deterministic finite automaton in Java - Take II
This time, I have added two DFA minimization algorithms to ...
6
votes
1
answer
267
views
Deterministic finite automaton in Java - Take II
(This is the continuation of Deterministic finite automaton in Java.)
(The repository is here.)
This time I have reworked the API and supplied a union DFA construction algorithm for additional fun.
...
4
votes
4
answers
545
views
Java batch processor
I had written a batch processor in Java a long time ago.
The code basically accepts Callables and executes them.
...
8
votes
5
answers
867
views
Circular Linked List Implementation
I am currently taking a data structures course at my university right now. I've recently learned about linked lists. Here is my attempt at creating a doubly circular linked list in Java. Is there ...
2
votes
3
answers
645
views
Sorting huge data int files externally - a toolkit in Java
In this post, I will present an algorithm for doing external sorting of int keys when the entire data does not fit in the main memory. Below are the repositories:
...
0
votes
2
answers
72
views
ContinuousRandomVariables.java - tiny Java library for dealing with a couple of continuous random variable distributions
This time, I have extended DiscreteRandomVariables.java to three (3) continuous random variables: ContinuousRandomVariables.java.
Code
...
6
votes
2
answers
177
views
DiscreteRandomVariableDistribution.java - A small collection of discrete random variable distributions
This time, I have a simple Java framework for sampling from discrete random variable distributions.
The entire project lives here. It has 100% test coverage.
Code
...
4
votes
2
answers
305
views
Simulating die streaks and counting the number of matches in Java
Intro
Suppose we throw a die \$N\$ times. Before writing this program, I was puzzled by a question: How should I approach each trial. I got two options:
Choose a single die number, count how many ...
5
votes
1
answer
235
views
ObjectBucketSort.java with running time statistics
Intro
This time, I present the ObjectBucketSort, a stable sorting algorithm for objects.
Code
...