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,091
questions
6
votes
3
answers
1k
views
Implementation of Euler-Maruyama numerical solver
I am trying to write a python implementation of Euler-Maruyama and Milstein schemes for numerically solving stochastic differential equations. The pseudo-code for the algorithms is in the Wikipedia ...
0
votes
1
answer
41
views
reassigning a variable with a divide operator gives nan in program when zero is entered [closed]
Please keep in mind that I am very new to programming.
I was given a the following question as my assignment in C++:
Write a program that computes the value of an nth degree polynomial $$A(x)=a_0+...
1
vote
0
answers
52
views
Principal Variation Search (PVS) for playing Connect Four in Java
This time, I have an implementation of PVS (Principal Variation Search) algorithm for playing the game of Connect Four.
The repository holding the above .java file ...
1
vote
0
answers
40
views
Negamax with Alpha-beta pruning for playing Connect Four in Java
I have this repository.
My main concern this time is my implementation of the Negamax algorithm with alpha-beta pruning:
...
0
votes
1
answer
49
views
Negamax AI for playing Connect Four against Alpha-beta pruning AI in Javascript
The working page is in GitHub.
Introduction
This time, I have two AI bots playing Connect Four against each other. The first AI bot uses Alpha-beta pruning, and the other one uses a Negamax with Alpha-...
6
votes
2
answers
398
views
Family, felon & fuzz River Crossing challenge
I first saw this challenge when a user posted it to SO about two years ago without a shred of code.
The post's plea, "How do I get started?" meant the user's post didn't survive long on that ...
2
votes
0
answers
40
views
Connect Four AI vs. AI match in Javascript
This time, I have a Javascript program that runs a Connect Four match between two Alpha-beta pruning based AI bots. (See this page.)
ai-battle.html:
...
9
votes
3
answers
514
views
Form all possible well-formed strings of 'n' nested pairs of 2 types of ASCII brackets
Taking an interest in the challenge presented in this recent Code Review question, I've concocted a C solution (valid as C++, if I'm not mistaken) seeking to reduce both the lines of code and the ...
2
votes
2
answers
58
views
LFU cache in Kotlin
I've been working on the classic LFU (Least Frequently Used) cache running in O(1) time problem lately and, as a student, I kind of struggled with the algorithms I found online. I got most of the idea ...
4
votes
1
answer
87
views
Multithreaded Alpha-beta pruning for playing Connect Four in Java
Intro
(The entire repository is in GitHub.)
This time, I have parallelized the famous Alpha-beta pruning algorithm. The idea is that the parallel algorithm descends in a game tree (at least) 2 levels ...
5
votes
1
answer
93
views
ConnectFourFX.java - A Java FX GUI app for playing Connect Four against AI
GitHub
The entire project relies here (ConnectFourFX.java) and is dependent on Connect4.java.
Code
com.github.coderodde.game.connect4.ConnectFourBoard.java:
...
2
votes
1
answer
54
views
Combining multiple regexps using the `|` operator and grouping the regexps by their flags
I've implemented a function that creates a multiple regular expressions predicate. The idea behind the predicate is combining regular expressions using the disjunction operator ...
4
votes
3
answers
273
views
Connect4.java - The Connect Four game against an Alpha-beta pruning -based AI bot
I have this GitHub repository. It implements the command-line version of the Connect Four game. The AI bot is implemented via Alpha-beta pruning.
Code
...
1
vote
1
answer
82
views
Rewriting the java.util.concurrent.ConcurrentSkipListMap to a version without concurrency constructs
I have essentially rewrote the java.util.concurrent.ConcurrentSkipListMap into a version without concurrency constructs (...
2
votes
2
answers
158
views
Find the join of two set partitions
Two partitions of a set have a greatest lower bound (meet) and a least upper bound (join).
See here: Meets and joins in the lattice of partitions (Math SE)
The meet is easy to calculate. I am trying ...