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.
                5,122 questions
            
            
            
                2
            
            votes
        
        
            
                1
            
            answer
        
        
            
                145
            
            views
        
        
            
            
        A simple method for compressing white space in text (Java)
                    Intro
Now I have that text space compressor. For example,
...
                
            
       
        
            
                2
            
            votes
        
        
            
                1
            
            answer
        
        
            
                103
            
            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
...
                
            
       
        
            
                0
            
            votes
        
        
            
                0
            
            answers
        
        
            
                59
            
            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....
                
            
       
        
            
                4
            
            votes
        
        
            
                2
            
            answers
        
        
            
                487
            
            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 (...
                
            
       
        
            
                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 ...
                
            
       
        
            
                4
            
            votes
        
        
            
                1
            
            answer
        
        
            
                87
            
            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 \...
                
            
       
        
            
                7
            
            votes
        
        
            
                4
            
            answers
        
        
            
                645
            
            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 ...
                
            
       
        
            
                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
...
                
            
       
        
            
                4
            
            votes
        
        
            
                2
            
            answers
        
        
            
                135
            
            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)\$...
                
            
       
        
            
                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 ...
                
            
       
        
            
                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 ...
                
            
       
        
            
                5
            
            votes
        
        
            
                2
            
            answers
        
        
            
                415
            
            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:
...
                
            
       
        
            
                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\$ ...
                
            
       
        
            
                4
            
            votes
        
        
            
                1
            
            answer
        
        
            
                284
            
            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\$ ...
                
            
       
        
            
                1
            
            vote
        
        
            
                0
            
            answers
        
        
            
                63
            
            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 ...
                
            
       
        