Skip to main content

Questions tagged [algorithm]

An algorithm is a sequence of well-defined steps that define an abstract solution to a problem. Use this tag when your issue is related to algorithm design.

1 vote
2 answers
52 views

A simple method for compressing white space in text (Java) - Take II

Intro In this post, I will elaborate on A simple method for compressing white space in text (Java). Here, I have incorporated some advice offered by Chris. Also, this version preserves a single new ...
coderodde's user avatar
  • 32k
1 vote
1 answer
84 views

Benchmarking in Java some super linearithmic sorting algorithms

Intro A sort is called super linearithmic if its running time is \$\omega(N \log N)\$. For example, \$f(N) = \omega(g(N))\$ means that \$f(N)\$ grows "faster" than \$g(N)\$. In this post, I ...
coderodde's user avatar
  • 32k
4 votes
1 answer
430 views

A simple method for compressing white space in text (Java)

(The story continues in A simple method for compressing white space in text (Java) - Take II.) Intro Now I have that text space compressor. For example, ...
coderodde's user avatar
  • 32k
2 votes
1 answer
113 views

ShannonFanoEncoder.java - computing prefix codes in Java

Intro This time, I have implemented the Shannon-Fano coding. Code io.github.coderodde.compression.ShannonFanoEncoder.java ...
coderodde's user avatar
  • 32k
0 votes
0 answers
60 views

Jump point search in Java for faster pathfinding in grid mazes

(Refer to the entire repository in GitHub.) How it looks like Intro This time, I present my take on Jump point search that I translated from Javascript (PathFinding.js/src/finders/JumpPointFinderBase....
coderodde's user avatar
  • 32k
4 votes
2 answers
489 views

Finding a sequence of xors to change a to b

I'm resolving a problem from CodeForces: C. Beautiful XOR. This is what the code is supposed to do: You have two numbers a and b. You must transform a into b using XOR operations (...
Jared McCarthy's user avatar
5 votes
2 answers
357 views

BRESort - Bitwise Relationship Extraction - Intelligent Adaptive Sorting Engine for 32/64-bit & Floating-Point Data

I want to begin by sincerely thanking the community for the invaluable feedback on my previous BRESort byte-sorting research. Your insights about enums, named constants, loop optimizations, and test ...
LazyCauchPotato's user avatar
4 votes
1 answer
88 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
  • 32k
7 votes
4 answers
647 views

My BRESort adaptive sorting engine in C

I've created BRESort - an adaptive sorting engine that dynamically selects optimal algorithms based on data patterns. It achieves 3.6-4.2x speedup over stdlib qsort ...
LazyCauchPotato's user avatar
0 votes
0 answers
65 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
  • 32k
4 votes
2 answers
136 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
  • 32k
5 votes
5 answers
1k views

Check whether a binary tree is symmetric

I implemented a recursive solution that compares the left and right subtree in mirrored fashion. It works for my test cases, but I would like to know if there are any best practices that would make ...
Jared McCarthy's user avatar
8 votes
2 answers
297 views

Implementation of a kd-tree header-only library

I've took inspiration from https://www.geeksforgeeks.org/cpp/kd-trees-in-cpp/ and implemented a kdtree library and I would like to get a review of it. The main target was to have a kd-tree ...
Pangi's user avatar
  • 370
5 votes
2 answers
418 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
  • 32k
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
  • 32k

15 30 50 per page
1
2 3 4 5
342