Click here to Skip to main content
15,886,199 members
Everything / General Programming / Algorithms

Algorithms

algorithm

Great Reads

by Arthur V. Ratz
In this article we'll demonstrate the implementation of k-means clustering algorithm to produce recommendations.
by Igor Ladnik
Automatic generation of optimal control policies for the basic quadcopter flight modes
by Eric Ouellet, Sani Huttunen
Fast implementations of permutation algorithms
by Dmitriy Gakh
Development in C# without care of resource consumption can lead to overloading the system. This article describes a case with large waste of memory and CPU time and how to avoid it.

Latest Articles

by Igor Gribanov
C++ iterators and algorithms work well for containers, but can we sort the Structure of Arrays?
by Henrik Vestermark
The steps needed to build an Interval Arithmetic class in C++
by Ștefan-Mihai MOGA
How to solve real-life problems using B-trees
by Nicolas DESCARTES
How to implement logistic regression in ML.NET?

All Articles

Sort by Score

Algorithms 

25 Dec 2016 by Arthur V. Ratz
In this article we'll demonstrate the implementation of k-means clustering algorithm to produce recommendations.
20 Jun 2022 by Igor Ladnik
Automatic generation of optimal control policies for the basic quadcopter flight modes
11 Oct 2022 by Eric Ouellet, Sani Huttunen
Fast implementations of permutation algorithms
28 Aug 2015 by Dmitriy Gakh
Development in C# without care of resource consumption can lead to overloading the system. This article describes a case with large waste of memory and CPU time and how to avoid it.
13 Sep 2021 by Mircea Neacsu
Various algorithms for 2D interpolation
26 Apr 2018 by Mahsa Hassankashi
Best practice for opinion and Text Mining based on Naïve Bayesian Classifier.
29 Aug 2017 by Arthur V. Ratz
How to implement k-means clustering algorithm to perform graphical raster image segmentation
2 May 2022 by KristianEkman
How to build an AI which plays Backgammon
8 Apr 2020 by Gunnar S
Implementation of the Poisson Cumulative Distribution function for large Lambdas
7 Sep 2010 by Colin Vella
This article presents an algorithm and data structures to implement auto-tiling as seen in RPG Maker, the Starcraft level editor, etc.
11 Jan 2023 by Andrea Simonassi
A simple yet powerful multiplication algorithm
17 Feb 2015 by DrABELL
Educational software package for Microsoft Windows® 7/8 contains “5-in-1” School Math Calculators and Equation Solvers intended for students and educators
6 Sep 2016 by George Swan
An artificial life algorithm that attempts to solve a problem by flying a swarm of entities through a range of possible solutions where each entity is guided by the performance of other members of the swarm
27 Nov 2017 by Miguel Diaz Kusztrich
An infinite set of biological shape fractals in the complex plain
9 Sep 2021 by Mladen Janković
Improved algorithm for reconstructing game world map from captured game play
30 Dec 2018 by Arthur V. Ratz
SVD in C++11 explained with an example
4 Jun 2023 by GeorgeDS
An anecdotal report describing issues encountered in coding a minimal perceptual hash capability, in plain old C, in to 35 year old rolling development, with the goal of running on a noob Win 10/11 installation.
9 Sep 2018 by Philipp Sch
Finding a fundamental Cycle Set forming a complete basis to enumerate all cycles of a given undirected graph
1 Jun 2018 by User 6679439
16 Apr 2022 by tugrulGtx
A walkthrough for a grid implementation of "particle in cell" problem to improve performance of axis-aligned bounding-box (AABB) collision checking in various scenarios
16 Apr 2022 by Patrice T
RLE (Run Length Encoding): The Human Friendly Compression
6 Oct 2020 by Christ Kennedy
A graphically bouncy and colorful version of the popular numbers tile-sliding game
13 Oct 2013 by Member 9294701
A simple, portable yet efficient Quicksort implementation in C
2 Sep 2021 by Peter Occil
Algorithms to turn biased "coin flips" into biased "coin flips", and how to code them.
19 Jan 2022 by trekhleb
JavaScript implementation of so-called Seam Carving algorithm for content-aware image resizing
22 Apr 2016 by Darryl Bryk
C# code for a low-pass Butterworth filter is presented
3 Jan 2022 by Arthur V. Ratz
Optimizing the performance of the large-sized matrices QR factorization and eigendecomposition, using Schwarz-Rutishauser algorithm
27 Oct 2015 by Daniel Pfeffer
A faster method for performing interval arithmetic
7 Jun 2016 by GProssliner
cobj is a preprocessor based generator for interface based polymorphism
24 Apr 2022 by Marcus Müller
Pandemic SEIR and SEIRV modelling software and infrastructure for the Corona SARS-COV-2 COVID-19 disease with data from Johns-Hopkins-University CSSE, Robert Koch-Institute and vaccination data from Our World In Data.
13 Mar 2019 by Oana Mancu
Any deterministic game can be broken down to its core functionalities. By understanding them, one can implement fundamental algorithms such as Minimax (with alpha beta pruning), thus paving the way towards a better AI opponent.
16 Sep 2022 by Arthur V. Ratz
Compute the Levenshtein distance of literal strings effectively by using the Wagner-Fischer (two matrix rows-based) algorithm.
11 Oct 2023 by Henrik Vestermark
Practical implementation of a fast, robust and reliable polynomial root finder using Newton's method
26 Nov 2018 by Jonas Selling
Clarifying the use of multi-pass filter cutoff correction
4 Sep 2020 by Mosi_62
Logistic regression, back propagation and support vector machine in comparison on the Iris data set
10 Oct 2020 by Sandeep Mewara
An optimization programming technique
13 Apr 2022 by Steve Hageman
A Python Library to help make properly scaled Fourier Transforms including utility functions
10 Nov 2014 by Cryptonite
This is how to use the bisection method to calculate the nth root of a positive real number.
29 Sep 2013 by Amit Bezalel
Transfering subtitle synchronization from one subtitle file to another
18 Aug 2014 by José Cintra
Some suggestions of algorithms for solving the Pascal Triangle, addressing iterative, recursive and functional paradigms
29 Aug 2015 by Eric Z (Jing)
The traditional way to solve the ZigZag Conversion problem is to either build a 2d table or find a pattern among the index of the letters on the same row. There is also a beautiful solution which builds on top of Breadth First Search. Continue reading..
25 Nov 2018 by Bartlomiej Filipek
What performance can we get from C++17 parallel algorithms?
30 Apr 2021 by ADMGNS
An alternative method to Catmull-Rom, Chaikin or Bezier curve smoothing methods
15 Sep 2023 by optiklab1
I demonstrate with an actual implementation that well-known algorithms BFS, DFS, Dijkstra, and A-Star are essentially variations of the same algorithm.
31 Jul 2012 by Kenneth Haugland
How to calculate a reverbration time in a room
13 Dec 2014 by Andreas Gieriet
I prefer to encapsulate the status and access to it.The idea behind this: since the string is already grouped or sorted by characters, we can traverse the string from left to right and maintain a current state (which character with how many instances at that point). If the number of character...
26 Mar 2015 by BrainlessLabs.com
This tip describes a n ary tree structure.
4 Mar 2016 by JorgeLuisOrejel
This article is based on Chapter 2 of my unpublished textbook “Applied Algorithms and Data Structures.”
27 Apr 2018 by Arthur V. Ratz
In this article, we will formulate and discuss CLOPE data mining clustering algorithm that allows to drastically increase the quality and efficiency of categorized data clustering and can be easily used for recommendation-specific purposes
14 Jun 2021 by gggustafson
This article revises an earlier revision of the Gradient Color Picker (V2). The incentive for the revision was a reader request for a larger number of initial color choices.
11 Nov 2023 by Henrik Vestermark
Practical implementation of a fast, robust and stable polynomial root finder using Halley's method
12 Jan 2024 by Nicolas DESCARTES
How to implement logistic regression in ML.NET?
6 Apr 2012 by Wonde Tadesse
Here are some algorithm books.Data Structures and Algorithm Analysis(C++)[^]Data Structures and Algorithm Analysis(Java)[^]Data Structures and Algorithms[^]You can get a free book from here.http://freecomputerbooks.com/[^]
14 Jun 2012 by Sergey Alexandrovich Kryukov
Please see my comment to the question. You need to specify your application type or UI library you want to use. If you don't have preference, you should tell us about it, as "what would you advise".Now, very clear tutorial is — on what topic? Don't expect and look for tutorials on...
20 Jan 2013 by Joezer BH
Hello Chona1171, A most common solution algorithm for your problem is to use the Dijkstra's Algorithm.Click to read about Dijkstra's AlgorithmThere's this nice article in CodeProject:C# - Visualizing Path Finding With Dijkstra, AStar, Bi-directional Dijkstra's, and Bi-directional...
19 May 2014 by databaseobjectmodel
8 Feb 2015 by Emiliano Musso
How to apply GA techniques fo solving problems in VB.NET. The example shows how to create solutions for a 2D maze, which will evolve to find the shortest path between two points.
16 Dec 2015 by Jesús Utrera
Using text retrieval TF-IDF technique to rank tokens in a text document
16 Mar 2022 by Peter Occil
Python code for partially-sampled random numbers for accurate arbitrary-precision sampling
26 Apr 2021 by gggustafson
How well does the Interpolation of Colors match the Colors produced by Microsoft's Linear Gradient Brush?
6 Oct 2021 by Igor Gribanov
An efficient algorithm for assembling sparse matrices in Compressed Sparse Row (CSR) format.
8 Jan 2024 by Nicolas DESCARTES
What clustering algorithm should be selected for the clustering task?
10 Aug 2010 by anshulskywalker
Understanding of Example Based Machine Translation (EBMT) system and how to create your own using exisiting tools
31 Jan 2011 by Nebula2028
Steps as above (Answer 1) - however, you could use a ListView instead of a listbox. Set the "view" property to "details" though! Add a ListViewItem for the e.g. ID and to that ListViewItem, add a subitem for the Address.Hope I'm not too wide of the mark here!
14 Jun 2012 by Espen Harlinn
Most likely you can use the Graph# library[^].Best regardsEspen Harlinn
14 Jun 2012 by VJ Reddy
Please see this CodeProject article Graphical BinaryTrees[^]In this article it is written that "This article is about binary trees. A Binary Tree contains unlimited number of nodes, the nodes can be removed, added, searched, etc. Here we will discuss on how to make a binary tree on c# code,...
20 Jun 2012 by Andreas Gieriet
This is an alternative for "Converting Postfix Expressions to Infix"
5 Nov 2012 by OriginalGriff
OK - look at it in parts: srand((unsigned) time(NULL));Initialises a random number generator. const int passLen = 10; for (int i = 0; i
22 Jan 2014 by Sergey Alexandrovich Kryukov
The best algorithm for storing passwords is not storing any passwords; this is unsafe and absolutely not needed for authentication.Surprised, disagree? Please see my past answers:i already encrypt my password but when i log in it gives me an error. how can decrypte it[^],Decryption of...
12 Dec 2014 by Thomas Daniels
Arrays are zero-based; by starting with i = 1 you skip one element. And by using c.Length - 1, you also skip the last element. You also don't need to store the whole list, you can store only the longest. It's also better to use StringBuilder than string concatenation. And the temp =...
16 Feb 2015 by Eric Z (Jing)
Evaluation order matters!
20 Oct 2015 by Sergey Alexandrovich Kryukov
I just realized that this is very similar to the well-known Knapsack problem, only you don't need to find the optimal solution, just need to list them all: https://en.wikipedia.org/wiki/Knapsack_problem[^].From this article, you can find the overview of known solutions. Not all of them will...
29 Jul 2017 by Debashis 10433656
How to create an ASP.NET control for image resizer and cropper keeping aspect ratio
19 Aug 2020 by MehreenTahir
In this article we create a web app that trains the classifier on the go and recognizes grumpy facial expressions.
17 Apr 2023 by Mark H Bishop
Computational classes and a GUI interface to illustrate usage
20 Jul 2019 by Arthur V. Ratz
How to perform ARL by using FPGrowth algorithm
24 May 2020 by User 5250478
Application to show how to zigzag order a matrix
16 Mar 2024 by Henrik Vestermark
The steps needed to build an Interval Arithmetic class in C++
2 Dec 2017 by User 6679439
Library extending the .NET numeric support
18 May 2010 by xprog
Algorithm to convert Arabic Numbers to Arabic Text using C#
7 Nov 2010 by Pete O'Hanlon
You could always take a look at a project such as this[^] for sample code and projects to help you.
19 Dec 2010 by OriginalGriff
Yes, it will do.Because all you check for in the loop guard is "nums[i]
1 Mar 2011 by OriginalGriff
I would suggest that you start with Google: A little research goes a long way!http://www.google.co.uk/search?aq=f&sourceid=chrome&ie=UTF-8&q=Branch+and+Bound+algorithm+java[^]
22 Sep 2011 by Sergey Alexandrovich Kryukov
Private key is never sent; it would defeat the purpose of public-key security. You can exchange information with anyone even if someone spies on your connection all the time. You send public key to your partner. The public key is used to encrypt and cannot decrypt, you keep your private key...
29 Nov 2011 by Sergey Alexandrovich Kryukov
This is your graduation work. How can you demand a serious answer? Sorry, you cannot even correctly pose the problem and do not look competent in your own graduation work but want to get a credit (and a diploma!) for that. How are you going to make one of the experts interested in helping you?...
6 Feb 2012 by Espen Harlinn
Have a look at:WPF: A* search[^]It does most of what you actually need. Best regardsEspen Harlinn
20 Feb 2012 by ZC123456
As a developer who has spent a fair amount of time tweaking code for performance optimization, I'm having some issues with this article.First of all, who has generally accepted 10M iterations to test the performance? Unless your native code happens to be calling a function thousands or...
4 Sep 2013 by Grasshopper.iics
You would never want to use another photo editor in your AIO again
12 Dec 2014 by Maciej Los
I'd suggest to read this thread: Counting A Character[^].I do not see any performance issues by using Linq, unless the set of strings is very, very LARGE.It's really fast. Below query is executed in 0.001 sec.string input = "aaaabbcddddddddddeeffffg";var qry = (from c in input group...
12 Dec 2014 by BillWoodruff
Given the fact that the string is an ordered sequence, this gets very easy[1] to do with Linq:string test = @"aaaabbcddddddddddeeffffg";var longestGroup = test.GroupBy(ch => ch).OrderByDescending(grp => grp.Count()).First();char longestChar = longestGroup.Key;int...
3 Feb 2015 by Zoltán Zörgő
Here is the code of my approach:int max(int A, int B, int C){ return Math.Max(A, Math.Max(B,C));}void Main(){ var e = new byte[] {5,6,1,4,9,3,1,2}; var i=0; var j = e.Length-1; int A = e[i]; int C = e[j]; int B = 0; for(int x = i+1 ; x
29 Sep 2015 by nv3
After I read all the comments I feel tempted to give this basic problem a try. So, if I understand the problem correctly, the number of aliens living on day n is the number of aliens of the previous day (nobody dies) plus the number of eggs that hatch on this day. The latter is equal to the...
11 Oct 2015 by OriginalGriff
To answer your last two questions first:Yes.And Yes.The trouble is that this is a complicated area, and it's difficult to explain why algorithms are important in a small text box.There is a relationship between algorithms and programming, but it's not always obvious because an...
14 Dec 2016 by Paolo Parise
Graph intersection using map reduce and Akka
29 Nov 2016 by Miguel Diaz Kusztrich
Adding tools to help estimate the correct delay and embedding dimension