Skip to main content

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.

-1 votes
0 answers
86 views

Deque implementation around strategy design pattern (after second thought)

After the recommendations from the responses of Deque implementation around strategy design pattern (second thought) the java.util.Deque implemented through plain ...
user293682's user avatar
4 votes
1 answer
84 views

Dijkstra's algorithm for non-uniform undirected hypergraphs: Take II - bidirectional Dijkstra's algorithm with excellent performance

Intro (See the full repository here.) A non-uniform undirected hypergraph is a generalization of an undirected graph. It is defined as \$H = (X, E)\$, where \$X\$ is the set of vertices and \$E \...
coderodde's user avatar
  • 31.9k
4 votes
1 answer
173 views

API having flow - normal flow along with background poller(it also involves events which is not shown here)

We have an API in which we call external service with a tracking id.This first part of the API workflow makes an entry to the DB as SUBMITTED after the call to first external API say /E1 finishes and ...
yoda's user avatar
  • 277
-5 votes
0 answers
138 views

Deque implementation around strategy design pattern (second thought)

On a second thought, the Deque implementation around strategy design pattern changed with a new implementation of retainAll method according to the solution from ...
user avatar
0 votes
0 answers
63 views

Computing loan cuts leading to a global zero equity in a financial graph (Java)

Intro I won't specify the problem here, but instead, provide the link to the blog post discussing the problem and the full implementation. Code ...
coderodde's user avatar
  • 31.9k
4 votes
2 answers
132 views

Dijkstra's algorithm for non-uniform undirected hypergraphs

Intro (Repo here.) A non-uniform undirected hypergraph is a generalization of an undirected graph. It is defined as \$H = (X, E)\$, where \$X\$ is the set of vertices and \$E \subseteq \mathcal{P}(X)\$...
coderodde's user avatar
  • 31.9k
-4 votes
1 answer
98 views

Deque implementation around strategy design pattern

Implementation of java.util.Deque interface based on string of POJOs, that is plain old java object, encapsulating a field for holding reference to each object ...
user avatar
-3 votes
0 answers
65 views

Deque implementation around visitor design pattern

Implementation of java.util.Deque interface consisting of linked state objects (called Dual) and two sets of visitors (one for ...
user avatar
4 votes
2 answers
402 views

Ordinary insertion sort vs. straight insertion sort in Java (benchmark)

Intro So this time I wanted to find out which of the two insertion sort flavours are faster: Code io.github.coderodde.util.StraightInsertionSort.java: ...
coderodde's user avatar
  • 31.9k
0 votes
0 answers
57 views

Computing \$k\$ most reliable paths in undirected probabilistic graphs in Java

Intro (See MostProbablePath.java.) This time, I elaborate on Computing most probable (reliable) path in a probabilistic graph (take II): instead of computing the most reliable path I now return \$k\$ ...
coderodde's user avatar
  • 31.9k
4 votes
1 answer
281 views

Computing most probable (reliable) path in a probabilistic graph (take II)

Intro A probabilistic graph \$G = (V, E)\$ is an undirected graph with weight function \$w \colon E \rightarrow [0, 1]\$. In the most reliable path problem we -- given two terminal nodes \$s \in V\$ ...
coderodde's user avatar
  • 31.9k
0 votes
0 answers
70 views

Wrap java.awt.GridBagLayout

I appreciate the GridBagLayout of Java very much. But, it has one huge disadvantage: it is very much boilerplate code. You have to type too much. I would like to use the GridBagLayout of Java in the ...
preitinger's user avatar
1 vote
0 answers
62 views

PathFinding.java: Drawing a random perfect maze via randomized DFS

Intro Still working on PathFinding.java. This time I concentrate on three private methods of GridModel that are responsible for generating random perfect mazes. A maze is perfect if for each two cells ...
coderodde's user avatar
  • 31.9k
2 votes
2 answers
102 views

Checking for weak string isomorphism in Java

Intro I call two \$n\$-strings \$s\$ and \$z\$ over the alphabet \$\Sigma\$ weakly isomorphic if their character frequency multisets are equal. In other words, for an input strings \$s\$, we derive a ...
coderodde's user avatar
  • 31.9k
4 votes
1 answer
160 views

Checking for string isomorphism in Java

Intro Two \$n\$-strings \$s = \langle s_1 \ldots s_n \rangle \$ and \$z = \langle z_z \ldots z_n \rangle\$ are considered isomorphic if and only if there exists a bijection \$f\$ such that for all \$...
coderodde's user avatar
  • 31.9k

15 30 50 per page
1
2 3 4 5
727