Gang Of Coders
Home
About Us
Contact Us
All Algorithm Solutions on Gang of Coders
Total of 782 Algorithm Solutions
What is a plain English explanation of "Big O" notation?
Algorithm
Complexity Theory
Computer Science
Big O
Time Complexity
How do I check if an array includes a value in JavaScript?
Javascript
Arrays
Algorithm
Time Complexity
Javascript Objects
How can I pair socks from a pile efficiently?
Algorithm
Sorting
Language Agnostic
Matching
Removing duplicates in lists
Python
Algorithm
List
Duplicates
Intersection
Good algorithm and data structure for looking up words with missing letters?
Algorithm
Data Structures
How does 3D collision / object detection work?
Algorithm
Data Structures
3d
Collision Detection
Is there an O(n) integer sorting algorithm?
Algorithm
Language Agnostic
Sorting
Time Complexity
Edit Distance in Python
Python
Algorithm
Edit
Distance
RGB values of visible spectrum
Algorithm
Rgb
Big-O for Eight Year Olds?
Algorithm
Theory
Big O
Metrics
Calculate largest inscribed rectangle in a rotated rectangle
Algorithm
Math
Language Agnostic
Geometry
Complexity of list.index(x) in Python
Python
Algorithm
List
Big O
Performance
Python: maximum recursion depth exceeded while calling a Python object
Python
Algorithm
Recursion
Web Crawler
Depth
Check if a binary tree is a mirror image or symmetric
Algorithm
Language Agnostic
Data Structures
Binary Tree
Is there a diff-like algorithm that handles moving block of lines?
Algorithm
Diff
What are the main differences between the Knuth-Morris-Pratt and Boyer-Moore search algorithms?
Algorithm
Theory
String Search
Relaxation of an edge in Dijkstra's algorithm
Algorithm
Graph Theory
Graph Algorithm
Two Rectangles intersection
Algorithm
Math
Pseudocode
Shapes
Red-Black Trees
Algorithm
Binary Tree
Red Black-Tree
Algorithm to generate anagrams
Algorithm
Language Agnostic
Puzzle
Could a truly random number be generated using pings to pseudo-randomly selected IP addresses?
Algorithm
Theory
Random
How to pick color palette for a pie-chart?
Algorithm
Colors
Rgb
Leap year calculation
Algorithm
Calendar
Leap Year
Is it possible to guess a user's mood based on the structure of text?
Algorithm
Nlp
Algorithm to generate bit mask
C
Algorithm
Bit Manipulation
O(log N) == O(1) - Why not?
Performance
Algorithm
Computer Science
Big O
Learning Algorithms and Data Structures Fundamentals
Algorithm
Data Structures
find the only unpaired element in the array
Algorithm
Algorithms for determining the key of an audio sample
Algorithm
Audio
Analysis
Sampling
Audio Processing
How did Python implement the built-in function pow()?
Python
Algorithm
Math
Compare string similarity
C#
.Net
String
Algorithm
String Comparison
All Possible Combinations of a list of Values
C#
Algorithm
Math
Combinations
Finding maximum for every window of size k in an array
Algorithm
Most efficient way to find smallest of 3 numbers Java?
Java
Performance
Algorithm
Min
O(n log n) vs O(n) -- practical differences in time complexity
Algorithm
Big O
Time Complexity
What is a loop invariant?
Algorithm
Terminology
Definition
Clrs
Loop Invariant
How to efficiently compute average on the fly (moving average)?
Algorithm
Math
Average
Moving Average
Issues implementing the "Wave Collapse Function" algorithm in Python
Python
Algorithm
Markov Chains
Procedural Generation
Geo Fencing - point inside/outside polygon
Algorithm
Computational Geometry
String similarity metrics in Python
Python
Algorithm
String
Levenshtein Distance
Finding the best trade-off point on a curve
Algorithm
Matlab
Data Modeling
Model Fitting
What would be the fastest method to test for primality in Java?
Java
Performance
Algorithm
Primes
Collision detection of huge number of circles
Algorithm
Collision Detection
Geometry
C - How to implement Set data structure?
C
Algorithm
Math
Data Structures
Set
One-way flight trip problem
C
Algorithm
YouTube URL algorithm?
Algorithm
String similarity score/hash
Algorithm
Hash
Similarity
Why is the size 127 (prime) better than 128 for a hash-table?
Algorithm
Hash
Primes
How to divide a set into two subsets such that difference between the sum of numbers in two sets is minimal?
Arrays
Algorithm
Set
Most efficient/elegant way to clip a number?
C++
Algorithm
Math
Logic
What is the difference between dynamic programming and greedy approach?
Algorithm
Dynamic
Graph
Greedy
How to determine if a point is in a 2D triangle?
Algorithm
Math
Geometry
Merge Sort a Linked List
Algorithm
Sorting
Linked List
Mergesort
How do I efficiently determine if a polygon is convex, non-convex or complex?
Algorithm
Geometry
Polygon
Computational Geometry
Xlib
Write a program to find 100 largest numbers out of an array of 1 billion numbers
Algorithm
Sorting
How to add two numbers without using ++ or + or another arithmetic operator
C++
C
Algorithm
Bit Manipulation
how to check if a string looks randomized, or human generated and pronouncable?
Mysql
Algorithm
Nlp
Spam
Phonetics
Finding all disconnected subgraphs in a graph
Java
Algorithm
Graph
Disconnected
Subgraph
What is the best autocomplete/suggest algorithm,datastructure [C++/C]
C++
C
Algorithm
Search
Autocomplete
What is the best way to find all combinations of items in an array?
C#
Algorithm
Check for missing number in sequence
C#
Algorithm
Linq
Fastest way to calculate a 128-bit integer modulo a 64-bit integer
C
Algorithm
X86
Modulo
Assembly
How can I sort an STL map by value?
C++
Algorithm
Sorting
Dictionary
Stl
math/algorithm Fit image to screen retain aspect ratio
Algorithm
Image
Math
Graphics
Resize
Difference between average case and amortized analysis
Algorithm
Analysis
Octave : logistic regression : difference between fmincg and fminunc
Algorithm
Machine Learning
Neural Network
Octave
Probability of collision when using a 32 bit hash
Algorithm
Hash
Collision
Probability
Crc
java codility training Genomic-range-query
Java
Algorithm
Why is the constant always dropped from big O analysis?
Algorithm
Big O
Analysis
What is the correct way to obtain (-1)^n?
C++
Algorithm
X86
Cmath
Big-O complexity of a piece of code
Algorithm
Time Complexity
Why is the Big-O complexity of this algorithm O(n^2)?
Algorithm
Time Complexity
Big O
Complexity Theory
Asymptotic Complexity
Fit rectangle around points
C++
Algorithm
The fastest C++ algorithm for string testing against a list of predefined seeds (case insensitive)
C++
String
Windows
Algorithm
Why is it impossible to find a specified value in a sorted array faster than O(log n)?
Arrays
Algorithm
Time Complexity
Big O
Algorithm/Data Structure Design Interview Questions
Algorithm
Data Structures
Best hashing algorithm in terms of hash collisions and performance for strings
C#
Algorithm
Hash
Efficient way to search a stream for a string
Java
Algorithm
String
Search
Stream
How to count each digit in a range of integers?
Algorithm
Language Agnostic
Count
Clarion
Simple Python Challenge: Fastest Bitwise XOR on Data Buffers
Python
Algorithm
Performance
Xor
vba: get unique values from array
Vba
Algorithm
Excel
Unique
How should I map long to int in hashCode()?
Java
Algorithm
Hash
When should we use Radix sort?
Performance
Algorithm
Sorting
Quicksort
Radix Sort
Largest circle inside a non-convex polygon
Algorithm
Polygon
Computational Geometry
Geometry
Find the majority element in array
Arrays
Algorithm
Time Complexity
Hamming Distance vs. Levenshtein Distance
Algorithm
Diff
Nlp
Levenshtein Distance
Hamming Distance
How to implement 3 stacks with one array?
Algorithm
Data Structures
Stack
Easy interview question got harder: given numbers 1..100, find the missing number(s) given exactly k are missing
Arrays
Algorithm
Math
How does the algorithm to color the song list in iTunes 11 work?
Algorithm
User Interface
Itunes
Why does Python's itertools.permutations contain duplicates? (When the original list has duplicates)
Python
Algorithm
Language Design
Permutation
Stack with find-min/find-max more efficient than O(n)?
Java
Algorithm
Data Structures
Stack
Big O
Euler project #18 approach
Algorithm
Two elements in array whose xor is maximum
Arrays
Algorithm
Bit Manipulation
Xor
Find 2 numbers in an unsorted array equal to a given sum
Algorithm
Language Agnostic
Non-intersecting line segments while minimizing the cumulative length
C++
Performance
Algorithm
Geometry
Coupon code generation
C#
Algorithm
Hash
Coupon
Example of a factorial time algorithm O( n! )
Algorithm
Complexity Theory
Time Complexity
Factorial
Detecting if a string has unique characters: comparing my solution to "Cracking the Coding Interview?"
Java
String
Algorithm
Big O
Time Complexity
Nice & universal way to convert List of items to Tree
C#
.Net
Algorithm
Hierarchical Data
Is there a way to shorten this while condition?
C++
Algorithm
If Statement
While Loop
Simplify
How do you find a point at a given perpendicular distance from a line?
Algorithm
Math
Graphics
Geometry
Coordinates
Efficiently querying one string against multiple regexes
Regex
Algorithm
Pcre
What is a bubble sort good for?
Algorithm
Language Agnostic
Sorting
Bubble Sort
Weighted random selection with and without replacement
Python
Algorithm
Random
Random Sample
Mapping N-dimensional value to a point on Hilbert curve
Algorithm
Math
Hilbert Curve
Dimension Reduction
What is the difference between Linear search and Binary search?
Algorithm
Search
Binary Search
Linear Search
Algorithm challenge: Generate color scheme from an image
Image
Algorithm
Colors
Good algorithm for finding the diameter of a (sparse) graph?
Algorithm
Math
Graph Theory
fast algorithm for drawing filled circles?
C
Algorithm
Graphics
Geometry
How to intelligently degrade or smooth GIS data (simplifying polygons)?
Algorithm
Geometry
Gis
Postgis
What is the best 32bit hash function for short strings (tag names)?
Algorithm
Hash
Tags
32 Bit
How do I find the median of numbers in linear time using heaps?
Algorithm
Heap
Time Complexity
Median
What is the difference between bucket sort and radix sort?
Algorithm
Language Agnostic
Sorting
Radix Sort
Bucket
Division without using '/'
Algorithm
Bit Manipulation
Division
Difference between AVL trees and splay trees
Algorithm
Data Structures
Binary Search-Tree
Avl Tree
Splay Tree
When is doubly linked list more efficient than singly linked list?
Algorithm
Linked List
MD5 vs CRC32: Which one's better for common use?
Algorithm
Hash
Mastering Recursive Programming
Algorithm
Recursion
Data Structures
Recursive Datastructures
What algorithm can be used for packing rectangles of different sizes into the smallest rectangle possible in a fairly optimal way?
Algorithm
Packing
Javascript - Generating all combinations of elements in a single array (in pairs)
Javascript
Arrays
Algorithm
Combinations
Given two arrays, find the permutations that give closest distance between two arrays
Algorithm
How to read values from numbers written as words?
Algorithm
Language Agnostic
Parsing
Numbers
Nlp
What is an Efficient algorithm to find Area of Overlapping Rectangles
Algorithm
Optimization
Geometry
Performance
Algorithm for finding the smallest power of two that's greater or equal to a given value
C++
Algorithm
Assembly
Sum of digits of a factorial
Algorithm
Dynamic Programming
Sum of-Digits
Are there any better methods to do permutation of string?
C++
Algorithm
String
Permutation
What is the most clever and easy approach to sync data between multiple entities?
Database
Algorithm
Mobile
Synchronization
How does this work? Weird Towers of Hanoi Solution
Algorithm
Language Agnostic
Bit Manipulation
Towers of-Hanoi
Interview question - Search in sorted array X for index i such that X[i] = i
Java
C++
Arrays
Algorithm
Finding all possible combinations of numbers to reach a given sum
Algorithm
Search
Language Agnostic
Combinations
Subset Sum
Subset Sum algorithm
Algorithm
Dynamic Programming
Subset Sum
Elegant Python code for Integer Partitioning
Python
Algorithm
What is dynamic programming?
Algorithm
Dynamic Programming
Is there ever a good reason to use Insertion Sort?
Algorithm
Computer Science
What is image hashing used for?
Algorithm
Image
Hash
What is a good solution for calculating an average where the sum of all values exceeds a double's limits?
Java
Algorithm
Statistics
Looking for ways for a robot to locate itself in the house
Algorithm
Geolocation
Arduino
Robotics
Robot
Pick N distinct items at random from sequence of unknown length, in only one iteration
Python
Algorithm
Random
Generating a tower defense maze (longest maze with limited walls) - near-optimal heuristic?
Algorithm
Path Finding
Heuristics
Maze
Difference between Big-Theta and Big O notation in simple language
Algorithm
Big O
Big Theta
Why does QuickSort use O(log(n)) extra space?
Java
Algorithm
Sorting
Quicksort
Space Complexity
How to check if two words are anagrams
Java
String
Algorithm
Anagram
Zig-zag scan an N x N array
Php
Arrays
Algorithm
Zigzag
Why in a heap implemented by array the index 0 is left unused?
Algorithm
Heap
Prove a random generated number is uniform distributed
Algorithm
Computer Science
Swift: what is the right way to split up a [String] resulting in a [[String]] with a given subarray size?
Ios
Swift
Algorithm
Representing and solving a maze given an image
Python
Algorithm
Matlab
Image Processing
Maze
How to wrap part of a text in a node with JavaScript
Javascript
Html
Regex
Algorithm
Ukkonen's suffix tree algorithm in plain English
String
Algorithm
Data Structures
Language Agnostic
Suffix Tree
Javascript Array.sort implementation?
Javascript
Algorithm
Arrays
Sorting
The most efficient way to implement an integer based power function pow(int, int)
C
Algorithm
Math
Exponentiation
Determine font color based on background color
Algorithm
Language Agnostic
Colors
How to sort in-place using the merge sort algorithm?
Arrays
Algorithm
Sorting
Mergesort
In Place
Mapping two integers to one, in a unique and deterministic way
Algorithm
Mapping
Integer
Deterministic
Math
How are ssl certificates verified?
Algorithm
Security
Ssl
Certificate
Efficient Algorithm for Bit Reversal (from MSB->LSB to LSB->MSB) in C
C
Algorithm
Bit Manipulation
Calculate distance between two latitude-longitude points? (Haversine formula)
Algorithm
Math
Maps
Latitude Longitude
Haversine
Is log(n!) = Θ(n·log(n))?
Algorithm
Math
Recursion
Complexity Theory
Big O
Recursion or Iteration?
Performance
Algorithm
Language Agnostic
Recursion
What is the difference between LL and LR parsing?
Algorithm
Parsing
Compiler Construction
Ll
Lr
Skip List vs. Binary Search Tree
Algorithm
Language Agnostic
Data Structures
Binary Tree
Skip Lists
Are there any cases where you would prefer a higher big-O time complexity algorithm over the lower one?
Algorithm
Big O
Time Complexity
Find running median from a stream of integers
Algorithm
Heap
Median
How do I calculate a point on a circle’s circumference?
Algorithm
Math
Trigonometry
Get a random number focused on center
Javascript
Algorithm
Random
Numbers
What's the best way to model recurring events in a calendar application?
Ruby
Algorithm
Calendar
Data Modeling
Recurrence
Permutations between two lists of unequal length
Python
List
Algorithm
Itertools
Combinatorics
How to make rounded percentages add up to 100%
Algorithm
Math
Rounding
Percentage
Is it possible to get all arguments of a function as single object inside that function?
Javascript
Algorithm
Function
Arguments
Marshalling
Good Java graph algorithm library?
Java
Algorithm
Graph
How to determine the longest increasing subsequence using dynamic programming?
Algorithm
Computer Science
Dynamic Programming
Memoization
Lis
Given a number, find the next higher number which has the exact same set of digits as the original number
Algorithm
Digits
How can I find the time complexity of an algorithm?
Algorithm
Time Complexity
Complexity Theory
What is tail call optimization?
Algorithm
Recursion
Language Agnostic
Tail Recursion
Tail Call-Optimization
Understanding recursion
Algorithm
Recursion
Tail Recursion
When should I use Kruskal as opposed to Prim (and vice versa)?
Algorithm
Graph Theory
Minimum Spanning-Tree
Prims Algorithm
Kruskals Algorithm
What are good examples of genetic algorithms/genetic programming solutions?
Algorithm
Artificial Intelligence
Genetic Algorithm
Evolutionary Algorithm
How to find the kth largest element in an unsorted array of length n in O(n)?
Performance
Algorithm
Big O
Why is i-- faster than i++ in loops?
Javascript
Performance
Algorithm
Optimization
What are the differences between segment trees, interval trees, binary indexed trees and range trees?
Algorithm
Tree
Graph Algorithm
Interval Tree
Segment Tree
Detecting endianness programmatically in a C++ program
C++
Algorithm
Endianness
How do I use Node.js Crypto to create a HMAC-SHA1 hash?
Javascript
node.js
Algorithm
Hash
Node Crypto
Finding the max/min value in an array of primitives using Java
Java
Arrays
Algorithm
Frameworks
An algorithm for inflating/deflating (offsetting, buffering) polygons
Algorithm
Geometry
Polygon
Computational Geometry
Buffering
How to count the number of set bits in a 32-bit integer?
Algorithm
Binary
Bit Manipulation
Hammingweight
Iec10967
Big O, how do you calculate/approximate it?
Algorithm
Optimization
Complexity Theory
Big O
Performance
HSL to RGB color conversion
Algorithm
Colors
Rgb
Hsl
Finding all cycles in a directed graph
Algorithm
Graph Theory
Graph Algorithm
Effective method to hide email from spam bots
Html
Algorithm
Email
Spam
How might I find the largest number contained in a JavaScript array?
Javascript
Algorithm
Arrays
Max
Circle line-segment collision detection algorithm?
Algorithm
Math
Line
Collision Detection
Geometry
Which is the fastest algorithm to find prime numbers?
C++
Algorithm
Primes
Bomb dropping algorithm
Algorithm
Language Agnostic
Matrix
Fastest way to sort 10 numbers? (numbers are 32 bit)
Algorithm
Sorting
Insertion Sort
Sorting Network
How to compare two colors for similarity/difference
Algorithm
Colors
Compare
Rgb
Hsv
Efficient way to apply multiple filters to pandas DataFrame or Series
Python
Pandas
Algorithm
Filter
In-Place Radix Sort
Algorithm
Language Agnostic
Sorting
Radix Sort
In Place
What is the best way to compute trending topics or tags?
Algorithm
Tags
Information Retrieval
Given an array of numbers, return array of products of all other numbers (no division)
Arrays
Algorithm
Heap vs Binary Search Tree (BST)
Algorithm
Binary Tree
Heap
Binary Search-Tree
Breadth First Vs Depth First
Algorithm
Recursion
Depth First-Search
Breadth First-Search
Tree Traversal
What exactly does big Ө notation represent?
Algorithm
Computer Science
Big O
Notation
Big Theta
JavaScript - get the first day of the week from current date
Javascript
Algorithm
Picking a random element from a set
Java
Algorithm
Language Agnostic
Random
Set
Throwing the fattest people off of an overloaded airplane.
C++
Algorithm
Sorting
Stl
Difference between Divide and Conquer Algo and Dynamic Programming
Algorithm
Dynamic Programming
Divide and-Conquer
What are the mathematical/computational principles behind this game?
Algorithm
Math
Pseudocode
How does the HyperLogLog algorithm work?
Database
Algorithm
Math
Data Structures
Hyperloglog
How to efficiently compare two unordered lists (not sets) in Python?
Python
Algorithm
List
Comparison
Fastest way to flatten / un-flatten nested JSON objects
Javascript
Algorithm
Non-recursive depth first search algorithm
Algorithm
Tree
Are there any worse sorting algorithms than Bogosort (a.k.a Monkey Sort)?
Algorithm
Sorting
Big O
Rounding up to the nearest multiple of a number
C++
Algorithm
Rounding
How does finding a cycle start node in a cycle linked list work?
Algorithm
Linked List
Cycle
Floyd Cycle-Finding
Algorithm to find Largest prime factor of a number
Algorithm
Math
Prime Factoring
What is the fastest substring search algorithm?
C
Algorithm
String
Substring
Rolling or sliding window iterator?
Python
Algorithm
Select N random elements from a List<T> in C#
C#
Algorithm
Collections
Random
Element
How to efficiently build a tree from a flat structure?
Algorithm
Tree
Language Agnostic
Hierarchical Data
How to find the lowest common ancestor of two nodes in any binary tree?
Algorithm
Binary Tree
Complexity Theory
Least Common-Ancestor
Performing Breadth First Search recursively
Algorithm
Breadth First-Search
Unique (non-repeating) random numbers in O(1)?
Algorithm
Math
Random
Language Agnostic
Listing all permutations of a string/integer
C#
Algorithm
Permutation
Which sort algorithm works best on mostly sorted data?
Algorithm
Sorting
Rotating a point about another point (2D)
C++
Algorithm
Why would anyone use set instead of unordered_set?
C++
Algorithm
Data Structures
C++11
Algorithm to calculate the number of divisors of a given number
Performance
Algorithm
Pseudocode
Are 2^n and n*2^n in the same time complexity?
Algorithm
Big O
Complexity Theory
Time Complexity
Efficient way to insert a number into a sorted array of numbers?
Javascript
Algorithm
Sorting
When is each sorting algorithm used?
Algorithm
Sorting
Nearest neighbors in high-dimensional data?
Algorithm
Language Agnostic
Search
Machine Learning
Nearest Neighbor
When splitting an empty string in Python, why does split() return an empty list while split('\n') returns ['']?
Python
String
Algorithm
Parsing
Split
Diff Algorithm?
Algorithm
Diff
Vcdiff
Why doesn't Dijkstra's algorithm work for negative weight edges?
Algorithm
Graph Theory
Shortest Path
Dijkstra
Greedy
Sort points in clockwise order?
Algorithm
Math
Lua
Geometry
Computational Geometry
How do I determine whether my calculation of pi is accurate?
Algorithm
Math
Language Agnostic
Pi
How to generate all permutations of a list?
Python
Algorithm
Permutation
Combinatorics
Python 2.5
O(nlogn) Algorithm - Find three evenly spaced ones within binary string
Algorithm
Big O
How to merge two sorted arrays into a sorted array?
Java
Algorithm
Big O
Mergesort
What's a good rate limiting algorithm?
Python
Algorithm
Message Queue
Is using Random and OrderBy a good shuffle algorithm?
C#
Algorithm
Shuffle
Best way to randomize an array with .NET
C#
.Net
Algorithm
Sorting
Random
What is the most efficient way of finding all the factors of a number in Python?
Python
Algorithm
Python 2.7
Performance
Factorization
Pythonic way to check if a list is sorted or not
Python
Algorithm
List
Sorting
Why is the time complexity of both DFS and BFS O( V + E )
Algorithm
Time Complexity
Graph Theory
Breadth First-Search
Is this a "good enough" random algorithm; why isn't it used if it's faster?
Java
Performance
Algorithm
Random
Looping in a spiral
Algorithm
Matrix
Loops
Spiral
Tricky Google interview question
Algorithm
Optimization
Hamming Numbers
Smooth Numbers
Sorting 1 million 8-decimal-digit numbers with 1 MB of RAM
Algorithm
Sorting
Embedded
Ram
What is the method for converting radians to degrees?
Algorithm
Math
Trigonometry
Least common multiple for 3 or more numbers
Algorithm
Math
Lcm
Why prefer start + (end - start) / 2 over (start + end) / 2 when calculating the middle of an array?
C
Algorithm
Is it more efficient to copy a vector by reserving and copying, or by creating and swapping?
C++
Algorithm
Vector
Stl
Is Disney's FastPass Valid and/or Useful Queue Theory
Algorithm
Optimization
Performance
How does Dijkstra's Algorithm and A-Star compare?
Algorithm
Artificial Intelligence
Graph
A Star
Dijkstra
Evenly distributing n points on a sphere
Python
Algorithm
Math
Geometry
Uniform
Is there a way to measure how sorted a list is?
Arrays
Algorithm
List
Sorting
Is 161803398 A 'Special' Number? Inside of Math.Random()
C#
.Net
Algorithm
Random
Algorithm to compare two images
Algorithm
Image
Image Processing
Image Recognition
How can building a heap be O(n) time complexity?
Algorithm
Big O
Heap
Complexity Theory
Construction
How do you calculate the average of a set of circular data?
Algorithm
Math
Geometry
Kotlin - Idiomatic way to remove duplicate strings from array?
Algorithm
Kotlin
How to create the most compact mapping n → isprime(n) up to a limit N?
Algorithm
Math
Data Structures
Primes
Modular multiplicative inverse function in Python
Python
Algorithm
How Do I Choose Between a Hash Table and a Trie (Prefix Tree)?
Algorithm
Data Structures
Hashtable
Trie
Finding three elements in an array whose sum is closest to a given number
Arrays
Algorithm
hash function for string
C
Algorithm
Hash
Dictionary
Hashtable
Has anyone actually implemented a Fibonacci-Heap efficiently?
Performance
Algorithm
Language Agnostic
Data Structures
Fibonacci Heap
Generate an integer that is not among four billion given ones
Algorithm
File
Search
Out of-Memory
Memory Limit
Expand a random range from 1–5 to 1–7
Algorithm
Random
Puzzle
How do I create a URL shortener?
Algorithm
Url
how to calculate binary search complexity
Algorithm
Search
Time Complexity
Binary Search
Cartesian product of multiple arrays in JavaScript
Javascript
Arrays
Algorithm
Cartesian Product
Map Tiling Algorithm
Javascript
Html
Algorithm
Canvas
Set every cell in matrix to 0 if that row or column contains a 0
Algorithm
Optimization
Puzzle
Need for predictable random generator
C++
Algorithm
Random
How to hash a string into 8 digits?
Python
Arrays
Algorithm
Random
Hash
How to check whether two lists are circularly identical in Python
Python
Algorithm
Implement Stack using Two Queues
Algorithm
Data Structures
Stack
Throwing cats out of windows
Algorithm
Language Agnostic
Dynamic Programming
Asymptotic Complexity
What is Sliding Window Algorithm? Examples?
Algorithm
Sliding Window
What's the difference between backtracking and depth first search?
Algorithm
How to check if a number is a power of 2
C#
Algorithm
Math
Red black tree over avl tree
Algorithm
Data Structures
Red Black-Tree
Algorithm to detect intersection of two rectangles?
Algorithm
Math
Graphics
Geometry
Separating Axis-Theorem
Why use Dijkstra's Algorithm if Breadth First Search (BFS) can do the same thing faster?
Algorithm
Graph
Dijkstra
Breadth First-Search
What is a good Hash Function?
Algorithm
Language Agnostic
Hash
How does the Amazon Recommendation feature work?
Algorithm
Language Agnostic
Data Mining
What is the fastest/most efficient way to find the highest set bit (msb) in an integer in C?
C
Algorithm
Optimization
Bit Manipulation
How does one make a Zip bomb?
Algorithm
Compression
Examples of Algorithms which has O(1), O(n log n) and O(log n) complexities
Algorithm
Time Complexity
Data structures for loaded dice?
Algorithm
Language Agnostic
Data Structures
Random
Probability
Why does Java's Arrays.sort method use two different sorting algorithms for different types?
Java
Algorithm
Quicksort
Mergesort
What is the difference between a generative and a discriminative algorithm?
Algorithm
Machine Learning
Generative
Simple calculations for working with lat/lon and km distance?
Algorithm
Geometry
Geolocation
Which parallel sorting algorithm has the best average case performance?
Algorithm
Sorting
Concurrency
Which Java Collection should I use?
Java
Algorithm
Arraylist
Collections
Hashmap
What guarantees are there on the run-time complexity (Big-O) of LINQ methods?
C#
.Net
Linq
Algorithm
Complexity Theory
Why are λ-calculus optimal evaluators able to compute big modular exponentiations without formulas?
Algorithm
Haskell
Functional Programming
Lambda Calculus
Modular Arithmetic
How do you sort an array on multiple columns?
Javascript
Algorithm
Sorting
How to implement a queue with three stacks?
Algorithm
Data Structures
How to trace the path in a Breadth-First Search?
Python
Algorithm
Graph
Breadth First-Search
Given a string of a million numbers, return all repeating 3 digit numbers
Python
Algorithm
Data Structures
Number Theory
An efficient compression algorithm for short text strings
Algorithm
Compression
Algorithm to return all combinations of k elements from n
Algorithm
Combinations
Convert light frequency to RGB?
Algorithm
Language Agnostic
Rgb
Formula
Approximation
How to split text without spaces into list of words
Python
Algorithm
Text
Split
How do I check if a number is a palindrome?
Algorithm
Language Agnostic
Find a pair of elements from an array whose sum equals a given number
Algorithm
What is the most effective way for float and double comparison?
C++
Algorithm
Optimization
Floating Point
Why is Bubble Sort implementation looping forever?
Python
Algorithm
Sorting
Bubble Sort
Insertion Sort vs. Selection Sort
Algorithm
Sorting
Insertion Sort
Selection Sort
How do I check if a string is entirely made of the same substring?
Javascript
String
Algorithm
Cache Invalidation — Is there a General Solution?
Algorithm
Caching
Generalization
Cache Invalidation
Calculate the median of a billion numbers
Algorithm
Distributed Computing
How to implement a binary tree?
Python
Algorithm
Search
Data Structures
Binary Tree
Algorithm to generate a crossword
Algorithm
Crossword
Language Agnostic
What is the advantage to using bloom filters?
Algorithm
Data Structures
Bloom Filter
Maximum single-sell profit
Arrays
Algorithm
Big O
Time Complexity
About Python's built in sort() method
Python
Algorithm
Sorting
Python Internals
Can hash tables really be O(1)?
Algorithm
Performance
Language Agnostic
Big O
Hashtable
Finding duplicates in O(n) time and O(1) space
C++
C
Algorithm
What is the best way to get all the divisors of a number?
Python
Algorithm
Math
John Carmack's Unusual Fast Inverse Square Root (Quake III)
Algorithm
Floating Point
Square Root
Checking if all elements in a list are unique
Python
Algorithm
List
Unique
Negative weights using Dijkstra's Algorithm
Algorithm
Dijkstra
Shortest Path
Graph Algorithm
recursion versus iteration
Algorithm
Recursion
Iteration
Algorithm to generate all possible permutations of a list?
Algorithm
List
Permutation
How exactly does tail recursion work?
C
Algorithm
Recursion
Tail Recursion
Quicksort: Choosing the pivot
Algorithm
Sorting
Pseudocode
Quicksort
Rolling median algorithm in C
C
Algorithm
R
Statistics
Median
Polynomial time and exponential time
Algorithm
Where can I find the solutions to "The Algorithm Design Manual"?
Algorithm
Converting a Uniform Distribution to a Normal Distribution
Algorithm
Language Agnostic
Counting inversions in an array
Algorithm
What integer hash function are good that accepts an integer hash key?
C
Algorithm
Hash
design a stack such that getMinimum( ) should be O(1)
Algorithm
Language Agnostic
Data Structures
Stack
How do you detect Credit card type based on number?
Algorithm
Language Agnostic
E Commerce
What is pseudopolynomial time? How does it differ from polynomial time?
Algorithm
Big O
Time Complexity
What is the optimal Jewish toenail cutting algorithm?
Algorithm
Language Agnostic
Where can I get a "useful" C++ binary search algorithm?
C++
Algorithm
Stl
Binary Search
How to calculate an angle from three points?
Algorithm
Math
Geometry
Fast permutation -> number -> permutation mapping algorithms
Algorithm
Math
Permutation
Combinatorics
What does O(log n) mean exactly?
Algorithm
Time Complexity
Big O
A simple explanation of Naive Bayes Classification
Algorithm
Machine Learning
Dataset
Classification
Naivebayes
How to replace all occurrences of a character in string?
C++
Algorithm
Str Replace
Stdstring
Big O of JavaScript arrays
Javascript
Arrays
Algorithm
Big O
Time Complexity
Graph Algorithm To Find All Connections Between Two Arbitrary Vertices
Algorithm
Language Agnostic
Graph Theory
Quick Sort Vs Merge Sort
Algorithm
Sorting
What algorithm gives suggestions in a spell checker?
Algorithm
Language Agnostic
Spell Checking
Levenshtein Distance
Algorithm to find top 10 search terms
Algorithm
Data Structures
How to prove that a problem is NP complete?
Algorithm
Calculating new longitude, latitude from old + n meters
Algorithm
Geolocation
how to split an iterable in constant-size chunks
Python
Algorithm
Generator
Chunking
heapq with custom compare predicate
Python
Algorithm
Sorting
Dictionary
Containers
Compare Strings Javascript Return %of Likely
Javascript
String
Algorithm
Comparison
What algorithms compute directions from point A to point B on a map?
Algorithm
Path Finding
.NET - How can you split a "caps" delimited string into an array?
.Net
Regex
Algorithm
String
Pascalcasing
How to determine if binary tree is balanced?
Java
Algorithm
Data Structures
Binary Tree
How to find all combinations of coins when given some dollar value
Algorithm
Recursion
Puzzle
Coin Change
How does the MapReduce sort algorithm work?
Algorithm
Sorting
Parallel Processing
Hadoop
Mapreduce
Calculating frames per second in a game
Algorithm
std::back_inserter for a std::set?
C++
Algorithm
Stl
Difference between Prim's and Dijkstra's algorithms?
Algorithm
Graph
Dijkstra
Minimum Spanning-Tree
Prims Algorithm
What is the difference between trie and radix trie data structures?
Algorithm
Data Structures
Tree
Patricia Trie
Radix Tree
What is the most efficient/elegant way to parse a flat table into a tree?
Sql
Algorithm
Recursion
Tree
Hierarchical Data
Is this technically an O(1) algorithm for "Hello World"?
C#
.Net
Algorithm
Big O
Find kth smallest element in a binary search tree in Optimum way
Algorithm
Data Structures
Binary Tree
Binary Search
What would cause an algorithm to have O(log log n) complexity?
Algorithm
Big O
Time Complexity
Complexity Theory
Logarithm
Equation (expression) parser with precedence?
Algorithm
Parsing
Equation
Combined area of overlapping circles
Algorithm
Geometry
Area
How to reverse a singly linked list using only two pointers?
C
Algorithm
Data Structures
Linked List
Singly Linked-List
Algorithm to convert RGB to HSV and HSV to RGB in range 0-255 for both
C++
C
Algorithm
Time complexity of Euclid's Algorithm
Algorithm
Big O
Time Complexity
Iteration
How to find the kth smallest element in the union of two sorted arrays?
Arrays
Algorithm
Binary Search
Divide and-Conquer
Algorithm for classifying words for hangman difficulty levels as "Easy","Medium", or "Hard"
Algorithm
Rounding DateTime objects
C#
Algorithm
What is the difference between a heuristic and an algorithm?
Algorithm
Definition
Heuristics
Nomenclature
How does lucene index documents?
Algorithm
Indexing
Lucene
What would cause an algorithm to have O(log n) complexity?
Algorithm
Big O
Time Complexity
Logarithm
Big-oh vs big-theta
Algorithm
Complexity Theory
Image Segmentation using Mean Shift explained
Algorithm
Image
Image Processing
Image Segmentation
Why does Java's hashCode() in String use 31 as a multiplier?
Java
String
Algorithm
Hash
Algorithm to detect overlapping periods
C#
.Net
Algorithm
Datetime
Time
Algorithm for Determining Tic Tac Toe Game Over
Algorithm
State
Tic Tac-Toe
Check if two linked lists merge. If so, where?
Algorithm
Linked List
Data Structures
How to convert floats to human-readable fractions?
Algorithm
Language Agnostic
Numbers
Is there a perfect algorithm for chess?
Algorithm
Chess
Game Theory
How do Trigonometric functions work?
Algorithm
Math
Trigonometry
Is there any algorithm in c# to singularize - pluralize a word?
C#
Algorithm
Algorithm to get the excel-like column name of a number
Php
Algorithm
Optimization
Quicksort vs heapsort
Algorithm
Sorting
Quicksort
Heapsort
What is the difference between LR, SLR, and LALR parsers?
Algorithm
Parsing
Compiler Construction
Grammar
Lr
Find XOR of all numbers in a given range
Algorithm
Best way to reverse a string
C#
.Net
Performance
Algorithm
Unicode
Fast stable sorting algorithm implementation in javascript
Javascript
Algorithm
Sorting
Bitwise and in place of modulus operator
Algorithm
Maximum number of characters using keystrokes A, Ctrl+A, Ctrl+C and Ctrl+V
Algorithm
How do 20 questions AI algorithms work?
Algorithm
Artificial Intelligence
Time complexity of Sieve of Eratosthenes algorithm
Algorithm
Performance
Time Complexity
Sieve of-Eratosthenes
Why do we check up to the square root of a number to determine if the number is prime?
Algorithm
Primes
Primality Test
Quicksort with Python
Python
Algorithm
Sorting
Quicksort
Is it possible to simplify (x == 0 || x == 1) into a single operation?
C#
Algorithm
Optimization
Arithmetic Expressions
What's the fastest algorithm for sorting a linked list?
Algorithm
Sorting
Linked List
Complexity Theory
What is the fastest way to compute sin and cos together?
C#
C++
C
Algorithm
Math
Number.sign() in javascript
Javascript
Algorithm
Numbers
Sign
How to calculate percentage between the range of two values a third value is
Algorithm
Algorithm for creating a school timetable
Algorithm
Language Agnostic
Np
Why DFS and not BFS for finding cycle in graphs
Algorithm
Tree
Graph Theory
Depth First-Search
Breadth First-Search
Why does Dijkstra's algorithm use decrease-key?
Algorithm
Data Structures
Priority Queue
Graph Algorithm
Dijkstra
What is this odd sorting algorithm?
Python
Algorithm
Sorting
Write a function that returns the longest palindrome in a given string
Algorithm
Palindrome
Unfamiliar symbol in algorithm: what does ∀ mean?
Algorithm
Math
Symbols
Magic number in boost::hash_combine
C++
Algorithm
Boost
Hash
Magic Numbers
Understanding Time complexity calculation for Dijkstra Algorithm
Algorithm
Graph
Big O
Time Complexity
Dijkstra
Check if all elements in a list are identical
Python
Algorithm
Comparison
How can I measure the similarity between two images?
Algorithm
Language Agnostic
Image
Image Processing
Insertion sort vs Bubble Sort Algorithms
Algorithm
Sorting
How can I test whether a number is a power of 2?
C++
Algorithm
Bit Manipulation
What is the optimal algorithm for the game 2048?
Algorithm
Logic
Artificial Intelligence
2048
What is the time complexity of my function?
C
Algorithm
Time Complexity
Programmer Puzzle: Encoding a chess board state throughout a game
Algorithm
Language Agnostic
Puzzle
Chess
Looking for a good world map generation algorithm
Algorithm
Map
Terrain
Hash table runtime complexity (insert, search and delete)
Algorithm
Data Structures
Hash
Time Complexity
Hashtable
What's the Hi/Lo algorithm?
Database
Algorithm
Primary Key
Identifier
Hilo
Tetris-ing an array
Php
String
Algorithm
Calculating the position of points in a circle
Algorithm
Math
Trigonometry
Geometry
Calculate mean and standard deviation from a vector of samples in C++ using Boost
C++
Algorithm
Boost
Statistics
Mean
Find common substring between two strings
Python
String
Algorithm
Time Complexity
Dynamic Programming
A simple example for someone who wants to understand Dynamic Programming
Algorithm
Dynamic Programming
An algorithm to space out overlapping rectangles?
Algorithm
User Interface
Language Agnostic
Graphics
Finding index of nearest point in numpy arrays of x and y coordinates
Python
Algorithm
Numpy
What is an NP-complete in computer science?
Algorithm
Language Agnostic
Mathematical Optimization
Theory
Np Complete
Is the time-complexity of iterative string append actually O(n^2), or O(n)?
Python
String
Algorithm
Time Complexity
String Concatenation
How to convert a byte array to its numeric value (Java)?
Java
Algorithm
Bytearray
Numbers
What's the algorithm to calculate aspect ratio?
Javascript
Algorithm
Math
Crop
Aspect Ratio
Constant Amortized Time
Algorithm
Complexity Theory
Big O
Algorithm to find all Latitude Longitude locations within a certain distance from a given Lat Lng location
Algorithm
Geolocation
Gps
Location
Latitude Longitude
Most efficient way to store thousand telephone numbers
Algorithm
Data Structures
Fast prime factorization module
Python
Algorithm
Prime Factoring
algorithm used to calculate 5 star ratings
Algorithm
Weighted Average
Rating System
What's a good algorithm to determine if an input is a perfect square?
Algorithm
Math
Perfect Square
How do I calculate the area of a 2d polygon?
Algorithm
Geometry
2d
Quick and Simple Hash Code Combinations
C#
Algorithm
Hash
Hashcode
How to implement tag system
Algorithm
System
Tagging
What is O(log* N)?
Algorithm
Math
Complexity Theory
Logarithm
Iterated Logarithm
Searching in a sorted and rotated array
C++
C
Arrays
Algorithm
JavaScript: Calculate the nth root of a number
Algorithm
Math
Javascript
Why does the greedy coin change algorithm not work for some coin sets?
Algorithm
Greedy
Coin Change
Difference between Jaro-Winkler and Levenshtein distance?
Performance
Algorithm
Levenshtein Distance
Jaro Winkler
How to detect a loop in a linked list?
Java
Algorithm
Data Structures
Linked List
Find the shortest path in a graph which visits certain nodes
Algorithm
Graph Theory
Dijkstra
Algorithm: efficient way to remove duplicate integers from an array
C
Algorithm
Arrays
Duplicates
How do I search for a number in a 2d array sorted left to right and top to bottom?
Algorithm
Search
Multidimensional Array
Breadth First Search time complexity analysis
Algorithm
Graph
Time Complexity
Breadth First-Search
How do you like your primary keys?
Algorithm
Database Design
Relational Database
Primary Key
Ddl
Swap two variables without using a temporary variable
C#
Algorithm
Swap
Undo/Redo implementation
Algorithm
Design Patterns
How does the Google "Did you mean?" Algorithm work?
Algorithm
Machine Learning
Nlp
Spell Checking
Text Search
The Most Efficient Way To Find Top K Frequent Words In A Big Word Sequence
Algorithm
Word Frequency
Easiest algorithm of Voronoi diagram to implement?
Algorithm
Diagram
Voronoi
Finding the position of the maximum element
C++
Algorithm
Algorithm to check similarity of colors
Algorithm
Colors
Comparison
Rgb
Generating all permutations of a given string
Java
Algorithm
What is amortized analysis of algorithms?
Algorithm
Analysis
Amortized Analysis
Find the smallest positive integer that does not occur in a given sequence
Algorithm
Is it faster to sort a list after inserting items or adding them to a sorted list
Algorithm
Sorting
List
Inverting a 4x4 matrix
C++
Algorithm
Math
Matrix
Matrix Inverse
Can You Use Arithmetic Operators to Flip Between 0 and 1
Algorithm
Calculate minimal operations to make two tree structures identical
Algorithm
Tree
Comparison
Diff
Computer Science
Obfuscating an ID
Algorithm
Encryption
Count number of 1's in binary representation
Algorithm
Binary
How can Google be so fast?
Performance
Algorithm
Choosing an attractive linear scale for a graph's Y Axis
Algorithm
Math
Graph
How do I check if a directed graph is acyclic?
Algorithm
Theory
Directed Graph
Directed Acyclic-Graphs
Find the Smallest Integer Not in a List
Arrays
Algorithm
Finding whether a point lies inside a rectangle or not
Algorithm
Geometry
How to understand the knapsack problem is NP-complete?
Algorithm
Complexity Theory
What is the difference between LR(0) and SLR parsing?
Algorithm
Parsing
Compiler Construction
Lr
Worst case in Max-Heapify - How do you get 2n/3?
Algorithm
Tree
Heap
Time Complexity
Unsupervised clustering with unknown number of clusters
Algorithm
Math
Artificial Intelligence
Machine Learning
Cluster Analysis
Why does FFT produce complex numbers instead of real numbers?
Algorithm
Math
Audio
Signal Processing
Fft
How can I find the shortest path between 100 moving targets? (Live demo included.)
Javascript
Algorithm
Graph Theory
Efficient way to search an element
C
Arrays
Algorithm
Sorting
Search
How to implement a queue using two stacks?
Algorithm
Data Structures
Stack
Queue
Algorithm for finding similar images
Algorithm
Math
Image Comparison
Generating permutations lazily
Algorithm
Functional Programming
Clojure
Combinatorics
"On-line" (iterator) algorithms for estimating statistical median, mode, skewness, kurtosis?
Algorithm
Statistics
Iterator
Median
How does code completion work?
Algorithm
Autocomplete
Code Completion
Viola-Jones' face detection claims 180k features
Algorithm
Image Processing
Computer Vision
Face Detection
Viola Jones
Algorithms based on number base systems?
Algorithm
Math
Data Structures
Numbers
Number Systems
Suffix tree and Tries. What is the difference?
Algorithm
Data Structures
Trie
Suffix Tree
Generate all permutations of a list without adjacent equal elements
Python
Algorithm
Combinatorics
Differences between OT and CRDT
Algorithm
Paxos
Operational Transform
Crdt
Nosql
Sorting in Computer Science vs. sorting in the 'real' world
Algorithm
Sorting
Time Complexity
What is the best image downscaling algorithm (quality-wise)?
Algorithm
Image
Resize
What is tail recursion?
Algorithm
Language Agnostic
Functional Programming
Recursion
Tail Recursion
Image Processing: Algorithm Improvement for 'Coca-Cola Can' Recognition
C++
Algorithm
Image Processing
Opencv
Most elegant way to generate prime numbers
C#
Java
Algorithm
Primes
Obtaining a powerset of a set in Java
Java
Algorithm
Set
Powerset
Choice of programming language for learning data structures and algorithms
Algorithm
Data Structures
Language Agnostic
Difference between std::set and std::priority_queue
C++
Algorithm
Sorting
Priority Queue
What is the fastest way to transpose a matrix in C++?
C++
Algorithm
Matrix
Transpose
Best algorithm for detecting cycles in a directed graph
Algorithm
Graph Theory
Directed Graph
Image comparison - fast algorithm
Image
Algorithm
Comparison
Computer Vision
"For" loop first iteration
Python
Algorithm
Iteration
Support Resistance Algorithm - Technical analysis
Algorithm
Rounding to an arbitrary number of significant digits
Algorithm
Rounding
Significant Digits
When is it practical to use Depth-First Search (DFS) vs Breadth-First Search (BFS)?
Algorithm
Graph Algorithm
Graph Theory
Depth First-Search
Breadth First-Search
How is CPU usage calculated?
Algorithm
Performance
Cpu
Cpu Usage
Cpu Architecture
Comparing object graph representation to adjacency list and matrix representations
Algorithm
Graph
Graph Algorithm
Interview Question: Merge two sorted singly linked lists without creating new nodes
Algorithm
Singly Linked-List
Sort on a string that may contain a number
Java
Algorithm
String
Sorting
Comparison
How to rank a million images with a crowdsourced sort
Algorithm
Sorting
Crowdsourcing
LRU cache design
C++
Algorithm
Data Structures
Lru
Getting the closest string match
Algorithm
Language Agnostic
String Comparison
Levenshtein Distance
Take n random elements from a List<E>?
Java
Algorithm
Random
Sampling
Find all paths between two graph nodes
Algorithm
Graph Theory
Breadth First-Search
What is the time and space complexity of a breadth first and depth first tree traversal?
Algorithm
What is the minimum cost to connect all the islands?
Algorithm
Dynamic Programming
Mathematical Optimization
Linear Programming
Heuristics
Algorithm for Additive Color Mixing for RGB Values
Algorithm
Colors
How to detect patterns in (electrocardiography) waves?
Algorithm
Language Agnostic
Machine Learning
Signal Processing
Pattern Recognition
C# Determine Duplicate in List
C#
Linq
Algorithm
List
Generics
Efficiently find binary strings with low Hamming distance in large set
Algorithm
Bit Manipulation
Bitwise Operators
Hamming Distance
Representing logic as data in JSON
Json
Algorithm
Shortest Sudoku Solver in Python - How does it work?
Python
Algorithm
Example of O(n!)?
Java
Algorithm
Big O
Complexity Theory
Factorial
Implement a queue in which push_rear(), pop_front() and get_min() are all constant time operations
Algorithm
Data Structures
Queue
Big O
How to generate Sudoku boards with unique solutions
Algorithm
Puzzle
Sudoku
Comparison between timsort and quicksort
Algorithm
Sorting
Quicksort
Timsort
JavaScript Math.random Normal distribution (Gaussian bell curve)?
Javascript
Algorithm
Random
Distribution
Gaussian
How to make a for loop variable const with the exception of the increment statement?
C++
Algorithm
For Loop
Variables
Constants
How to sort depended objects by dependency
C#
Algorithm
Sorting
Dependencies
Topological Sort
Fastest sort of fixed length 6 int array
Algorithm
Sorting
Optimization
Gpgpu
Sorting Network
Does the range-based 'for' loop deprecate many simple algorithms?
C++
Algorithm
Stl
C++11
Foreach
What's the difference between `git diff --patience` and `git diff --histogram`?
Git
Algorithm
Diff
Git Diff
Efficient list intersection algorithm
Algorithm
List
Set Intersection
Mapping a range of values to another
Python
Algorithm
Explain this snippet which finds the maximum of two integers without using if-else or any other comparison operator?
C
Algorithm
Math
Bit Manipulation
Max
Algorithm for N-way merge
Algorithm
Merge
Explain Merkle Trees for use in Eventual Consistency
Algorithm
Nosql
Cassandra
Amazon Dynamodb
Riak
Algorithm for finding the fewest rectangles to cover a set of rectangles without overlapping
Algorithm
Language Agnostic
Geometry
Rectangles
Efficiency of purely functional programming
Algorithm
Functional Programming
Performance
Matrix multiplication: Small difference in matrix size, large difference in timings
C
Performance
Algorithm
Matrix Multiplication
How can I get the most frequent 100 numbers out of 4,000,000,000 numbers?
Java
Algorithm
Where do I find a standard Trie based map implementation in Java?
Java
Algorithm
Optimization
Trie
How to detect the BPM of a song in php
Algorithm
Audio
Signal Processing
Beat Detection
Find largest rectangle containing only zeros in an N×N binary matrix
Algorithm
Arrays
Algorithm for autocomplete?
Algorithm
Autocomplete
Scalability
Data Structures
Autosuggest
Difference between Big-O and Little-O Notation
Algorithm
Time Complexity
Big O
Asymptotic Complexity
Little O
Python: find closest string (from a list) to another string
Python
String
Algorithm
List
Difference between O(n) and O(log(n)) - which is better and what exactly is O(log(n))?
Algorithm
Data Structures
Complexity Theory
Big O
Logarithm
Amortized complexity in layman's terms?
Algorithm
Amortized Analysis
How would you write a program to generate Haiku?
Algorithm
Circular lock-free buffer
C++
Algorithm
Multithreading
Concurrency
Lock Free
How to calculate the entropy of a file?
Algorithm
File Io
Entropy
What, if anything, is wrong with this shuffling algorithm and how can I know?
Algorithm
Functional Programming
Shuffle
Weighted random selection from array
Arrays
Algorithm
Random
Why are Fibonacci numbers significant in computer science?
Algorithm
Math
Data Structures
Fibonacci
"Last 100 bytes" Interview Scenario
Java
Algorithm
C How to "draw" a Binary Tree to the console
C
Algorithm
Layout
Binary Tree
Smart progress bar ETA computation
Algorithm
User Interface
Language Agnostic
nth fibonacci number in sublinear time
Performance
Algorithm
Math
Time Complexity
Fibonacci
Writing your own square root function
Algorithm
Function
Math
Square Root
Newtons Method
Most elegant way to change 0 to 1 and vice versa
Java
Algorithm
The "guess the number" game for arbitrary rational numbers?
Algorithm
Math
Puzzle
Rational Numbers
Generating permutations of a set (most efficiently)
C#
Performance
Algorithm
Optimization
Permutation
What are some algorithms for comparing how similar two strings are?
Algorithm
Language Agnostic
String Comparison
Stdstring
Heuristics
What is stability in sorting algorithms and why is it important?
Algorithm
Sorting
Language Agnostic
Stability
robust algorithm for surface reconstruction from 3D point cloud?
Algorithm
3d
Computational Geometry
Select k random elements from a list whose elements have weights
Algorithm
Math
Random
Statistics
Probability
Javascript algorithm to find elements in array that are not in another array
Javascript
Jquery
Algorithm
Arrays
Maximize the rectangular area under Histogram
Algorithm
Generating combinations in c++
C++
Algorithm
Combinations
Why is quicksort better than mergesort?
Algorithm
Sorting
Language Agnostic
Quicksort
Mergesort
Difference between 2 numbers
C#
Algorithm
Math
Numbers
Finding height in Binary Search Tree
Algorithm
Recursion
Binary Search-Tree
Strategies for simplifying math expressions
Algorithm
Math
Simplify
Finding out nth fibonacci number for very large 'n'
Algorithm
Math
Fibonacci
Longest equally-spaced subsequence
Python
Algorithm
What's a good algorithm to generate a maze?
Algorithm
Maze
Which is faster, Hash lookup or Binary search?
Algorithm
Hash
Hashmap
Lookup
Binary Search
Natural sort order string comparison in Java - is one built in?
Java
Algorithm
Comparator
Natural Sort
Algorithm to find next greater permutation of a given string
Algorithm
Test if a number is fibonacci
Algorithm
Testing
Math
Fibonacci
How to find a duplicate element in an array of shuffled consecutive integers?
Arrays
Algorithm
Duplicates
Permutation of array
Java
C++
Algorithm
Programming theory: Solve a maze
Algorithm
Maze
Finding All Combinations (Cartesian product) of JavaScript array values
Javascript
Algorithm
Possible Interview Question: How to Find All Overlapping Intervals
Algorithm
Rolling variance algorithm
Algorithm
Statistics
Variance
Storing 1 million phone numbers
Algorithm
Data Structures
Easiest way of using min priority queue with key update in C++
C++
Algorithm
Data Structures
Why do we use Base64?
Algorithm
Character Encoding
Binary
Ascii
Base64
What is the probability that the array will remain the same?
Algorithm
Math
Probability
Rotate image and crop out black borders
Python
Algorithm
Opencv
Aabb
How do I scale one rectangle to the maximum size possible within another rectangle?
Algorithm
Scaling
Detecting consecutive integers in a list
Python
Algorithm
List
How to find list of possible words from a letter matrix [Boggle Solver]
Algorithm
Puzzle
Boggle
What distribution do you get from this broken random shuffle?
Algorithm
Language Agnostic
Math
Random
Shuffle
Why not use heap sort always
Algorithm
Sorting
Heapsort
Best data structure for implementing a dictionary?
String
Algorithm
Dictionary
Data Structures
Binary Trees vs. Linked Lists vs. Hash Tables
Algorithm
Hashtable
Linked List
Binary Tree
Symbol Tables
Sparse matrices / arrays in Java
Java
Algorithm
Sparse Matrix
Sparse Array
Combine Gyroscope and Accelerometer Data
C
Algorithm
Accelerometer
Lego
Nxt
How to calculate elapsed time from now with Joda-Time?
Java
Algorithm
Datetime
Grails
Jodatime
Sorting an almost sorted array (elements misplaced by no more than k)
Arrays
Algorithm
Sorting
Find the 2nd largest element in an array with minimum number of comparisons
Arrays
Algorithm
Search
Calculate median in c#
C#
.Net
Algorithm
Median
Fastest way to get the integer part of sqrt(n)?
C++
C
Algorithm
Math
Performance
Why increase pointer by two while finding loop in linked list, why not 3,4,5?
Algorithm
Data Structures
Linked List
Cycle
Floyd Cycle-Finding
Calculating mid in binary search
Algorithm
Binary Search
Manacher's algorithm (algorithm to find longest palindrome substring in linear time)
Algorithm
Palindrome
Lazy Evaluation and Time Complexity
Algorithm
Sorting
Haskell
Lazy Evaluation
Time Complexity
How do I get the intersection between two arrays as a new array?
Java
C++
C
Algorithm
Cost of len() function
Python
Algorithm
Collections
Complexity Theory
Function for creating color wheels
Algorithm
Language Agnostic
Colors
Color Space
Best Compression algorithm for a sequence of integers
Algorithm
Compression
Most efficient way to see if an ArrayList contains an object in Java
Java
Algorithm
Optimization
Search
Arraylist
Is there an algorithm for color mixing that works like mixing real colors?
Algorithm
Colors
Language Agnostic
Blending
Color Space
Problem solving/ Algorithm Skill is a knack or can be developed with practice?
Algorithm
What is the complexity of the sorted() function?
Python
Algorithm
Sorting
Determine if two rectangles overlap each other?
C++
Algorithm
Geometry
Overlap
Rectangles
List of Big-O for PHP functions
Php
Performance
Algorithm
Arrays
Big O
best way to pick a random subset from a collection?
Java
Algorithm
Collections
Random
Subset
Algorithm for "nice" grid line intervals on a graph
Algorithm
Charts
Graph
What is the fastest integer factorization algorithm?
Algorithm
Math
Language Agnostic
Maple
Factorization
Algorithm Complexity & Security: MD5 or SHA1?
Algorithm
Hash
SVM - hard or soft margins?
Algorithm
Machine Learning
Svm
An inverse Fibonacci algorithm?
Algorithm
Math
Fibonacci
Equation for testing if a point is inside a circle
Algorithm
Language Agnostic
Geometry
Hash table - why is it faster than arrays?
Performance
Algorithm
Hash
Hashtable
Efficient swapping of elements of an array in Java
Java
Algorithm
Swap
A* Algorithm for very large graphs, any thoughts on caching shortcuts?
Algorithm
Openstreetmap
Graph Algorithm
Shortest Path
A Star
Evaluation & Calculate Top-N Accuracy: Top 1 and Top 5
Algorithm
Machine Learning
Evaluation
Top N
Fast String Hashing Algorithm with low collision rates with 32 bit integer
C++
Algorithm
String
Hash
What is the best algorithm for overriding GetHashCode?
.Net
Algorithm
Hashcode
Gethashcode
Millions of 3D points: How to find the 10 of them closest to a given point?
Algorithm
Graph
Graphics
Knn
Nearest Neighbor
How to estimate download time remaining (accurately)?
Algorithm
Download
Estimation
Where can I learn more about the Google search "did you mean" algorithm?
Algorithm
Nlp
Spell Checking
Given Prime Number N, Compute the Next Prime?
Algorithm
Math
Primes
Graph auto-layout algorithm
Algorithm
Layout
Graph
Nodes
Edges
Tersest way to create an array of integers from 1..20 in JavaScript
Javascript
Algorithm
Performance issue: Java vs C++
Java
C++
Performance
Algorithm
What is the difference between tree depth and height?
Algorithm
Data Structures
Tree
Nodes
Terminology
B-tree faster than AVL or RedBlack-Tree?
Algorithm
Data Structures
Binary Tree
Reverse the ordering of words in a string
Algorithm
Data Structures
String
How to cartoon-ify an image programmatically?
Algorithm
Image Manipulation
Command Line-Interface
Perceptron learning algorithm not converging to 0
C
Algorithm
Machine Learning
Neural Network
Perceptron
Generate all unique substrings for given string
Algorithm
Language Agnostic
Is the time complexity of the empty algorithm O(0)?
Algorithm
Math
Theory
Big O
Difference between hamiltonian path and euler path
Algorithm
Graph
Graph Theory
Hamiltonian Path
Euler Path
Is there any way to detect strings like putjbtghguhjjjanika?
Php
Algorithm
String
Algorithm: How do I fade from Red to Green via Yellow using RGB values?
C#
Algorithm
Rgb
Is a list (potentially) divisible by another?
Python
Algorithm
Numbers
Primes
Division
Algorithm to determine how positive or negative a statement/text is
Algorithm
Nlp
How do you validate a binary search tree?
Algorithm
Data Structures
Binary Search-Tree
Cycles in an Undirected Graph
Algorithm
Graph
Graph Theory
Create a hashcode of two numbers
.Net
Algorithm
Quickest way to find missing number in an array of numbers
Java
Arrays
Algorithm
Circle-circle intersection points
Algorithm
Math
Geometry
Intersection
Difference between back tracking and dynamic programming
Algorithm
Data Structures
What is the first character in the sort order used by Windows Explorer?
Windows
Algorithm
Programming Languages
Char
Special Characters
How to get a random element from a C++ container?
C++
Algorithm
Stl
Why is merge sort worst case run time O (n log n)?
Algorithm
Mergesort
Training a Neural Network with Reinforcement learning
Algorithm
Language Agnostic
Machine Learning
Neural Network
Reinforcement Learning
Difference and advantages between dijkstra & A star
Algorithm
Graph
Path Finding
Generate all combinations from multiple lists
Java
List
Algorithm
Combinations
Cartesian Product
Peak signal detection in realtime timeseries data
Algorithm
Language Agnostic
Time Series
Signal Processing
Data Analysis
Is there an efficient algorithm to generate a 2D concave hull?
Algorithm
Geometry
2d
Gis
Concave Hull
The best way to calculate the height in a binary search tree? (balancing an AVL-tree)
Algorithm
Data Structures
Binary Tree
Avl Tree
Tree Balancing
Generate all binary strings of length n with k bits set
Algorithm
Binary
Permutation
Combinations
Bits
Algorithm to calculate number of intersecting discs
Algorithm
Language Agnostic
std::transform() and toupper(), no matching function
C++
Algorithm
Stl
What's the best way to build a string of delimited items in Java?
Java
String
Algorithm
Finding the median of an unsorted array
Algorithm
Heap
Median
Most efficient code for the first 10000 prime numbers?
Performance
Algorithm
Primes
Random weighted choice
C#
Algorithm
Random
Is there an algorithm that tells the semantic similarity of two phrases
Algorithm
Nlp
Semantics
Algorithm to mix sound
Algorithm
Audio
Calculate Time Remaining
C#
Algorithm
is a "non-decreasing" sequence "increasing"?
Algorithm
Pseudorandom Number Generator - Exponential Distribution
Algorithm
Language Agnostic
Random
Exponential Distribution
How to find nth element from the end of a singly linked list?
Algorithm
Linked List
Data Structures
Getting the submatrix with maximum sum?
Algorithm
Dynamic Programming
Max
Submatrix
Find the row representing the smallest integer in row wise sorted matrix
Arrays
Algorithm
Language Agnostic
Matrix
search for interval overlap in list of intervals?
Algorithm
How to find maximum spanning tree?
Algorithm
Minimum Spanning-Tree
Greedy
Kruskals Algorithm
Find the number of occurrences of a subsequence in a string
Python
Algorithm
Dynamic Programming
Visualization of calendar events. Algorithm to layout events with maximum width
Javascript
Algorithm
Calendar
Visualization
Factorial Algorithms in different languages
Algorithm
Language Agnostic
Why there is no std::copy_if algorithm?
C++
Algorithm
Stl
How to find the intersection point between a line and a rectangle?
Algorithm
Geometry
Line
Intersection
find if 4 points on a plane form a rectangle?
C
Algorithm
Geometry
How can I compare two sets of 1000 numbers against each other?
Php
Javascript
Sql
Algorithm
What's the Time Complexity of Average Regex algorithms?
Regex
Algorithm
Complexity Theory
Find the first element in a sorted array that is greater than the target
Arrays
Algorithm
Binary Search
Finding the number of digits of an integer
Algorithm
Digits
Counting
How to approach a number guessing game (with a twist) algorithm?
Python
Algorithm
Tensorflow
Machine Learning
Keras
Point in Polygon Algorithm
C
Algorithm
What's the difference between recursion, memoization & dynamic programming?
Algorithm
Recursion
Dynamic Programming
Memoization
Creating all possible k combinations of n items in C++
C++
Algorithm
Math
Combinations
Combinatorics
Find duplicate element in array in time O(n)
Java
Arrays
Algorithm
Bellman-Ford vs Dijkstra: Under what circumstances is Bellman-Ford better?
Algorithm
Dijkstra
Shortest Path
Bellman Ford
What is difference between BFS and Dijkstra's algorithms when looking for shortest path?
Algorithm
Graph
Breadth First-Search
Shortest Path
Dijkstra
Fuzzy search algorithm (approximate string matching algorithm)
String
Algorithm
Search
Levenshtein Distance
Fuzzy Search
How do you rotate a two dimensional array?
Algorithm
Matrix
Multidimensional Array
What is the fastest way to get the value of π?
Performance
Algorithm
Language Agnostic
Unix
Pi
detect last foreach loop iteration
Java
Algorithm
Collections
What algorithm for a tic-tac-toe game can I use to determine the "best move" for the AI?
Algorithm
Artificial Intelligence
Tic Tac-Toe
Algorithm to find articles with similar text
String
Algorithm
Text
Language Agnostic
Similarity
How to round floats to integers while preserving their sum?
Algorithm
Language Agnostic
Rounding
Sorting algorithms for data of known statistical distribution?
Algorithm
Performance
Sorting
Statistics
Complexity Theory
Correctness of Sakamoto's algorithm to find the day of week
C
Algorithm
Dayofweek
Correctness
Emulate "double" using 2 "float"s
C++
Algorithm
Floating Point
Precision
Double Double-Arithmetic
Group array by subarray values
Php
Arrays
Algorithm
Sorting
What hashing function does Java use to implement Hashtable class?
Java
Algorithm
Hashtable
Hash
Understanding "median of medians" algorithm
Algorithm
Selection
Median of-Medians
How to implement classic sorting algorithms in modern C++?
C++
Algorithm
Sorting
C++14
C++ Faq
Splitting a string by a character
C++
String
Algorithm
What are the core mathematical concepts a good developer should know?
Algorithm
Math
Language Agnostic
Python Inverse of a Matrix
Python
Algorithm
Matrix
Linear Algebra
Matrix Inverse
How do ASCII art image conversion algorithms work?
Algorithm
Ascii Art
How to check if an integer is a power of 3?
Algorithm
Math
What is currently the most secure one-way encryption algorithm?
Algorithm
Security
Passwords
Md5
Password Hash
How can I print out all possible letter combinations a given phone number can represent?
Algorithm
Language Agnostic
Combinatorics
What Sorting Algorithm Is Used By LINQ "OrderBy"?
Linq
Algorithm
Sorting
Quicksort
What is the difference between genetic and evolutionary algorithms?
Algorithm
Genetic Algorithm
Evolutionary Algorithm
Find the least number of coins required that can make any change from 1 to 99 cents
Performance
Algorithm
Javascript data structures library
Algorithm
Data Structures
Javascript
Intuitive explanation for why QuickSort is n log n?
Algorithm
Complexity Theory
Quicksort
Which are the order matching algorithms most commonly used by electronic financial exchanges?
Algorithm
Finance
what is the difference between set and unordered_set in C++?
C++
Algorithm
Data Structures
C++11
Is complexity O(log(n)) equivalent to O(sqrt(n))?
Algorithm
Time Complexity
What are the pitfalls in implementing binary search?
Algorithm
Binary Search
What are the underlying data structures used for Redis?
Algorithm
Data Structures
Redis
How to find two most distant points?
Algorithm
Language Agnostic
Geometry
Hash : How does it work internally?
Java
Algorithm
Data Structures
Hash
Algorithm for simplifying decimal to fractions
C#
.Net
Algorithm
Math
What is the fastest way to flatten arbitrarily nested lists in Python?
Python
Algorithm
Optimization
Difference between priority queue and a heap
C++
Algorithm
Heap
Priority Queue
How to count integers between large A and B with a certain property?
Algorithm
Dynamic Programming
Extremely small or NaN values appear in training neural network
Algorithm
Haskell
Neural Network
Backpropagation
Efficiently getting all divisors of a given number
C++
Algorithm
Math
Factorization
Is there a nice way to assign std::minmax(a, b) to std::tie(a, b)?
C++
Algorithm
Reference
Stl
C++17
What is the right approach when using STL container for median calculation?
C++
Algorithm
Stl
Containers
Median
Higher-order unification
Algorithm
Artificial Intelligence
Logic
Unification
Parabolic knapsack
Algorithm
Np Hard
why is merge sort preferred over quick sort for sorting linked lists
Algorithm
Quicksort
Mergesort
Iterative DFS vs Recursive DFS and different elements order
C++
Algorithm
Graph
Depth First-Search
Traversal
How to implement O(logn) decrease-key operation for min-heap based Priority Queue?
Algorithm
Heap
Priority Queue
Decrease Key
Efficient way to remove half of the duplicate items in a list
Python
Algorithm
Function to make a list as unsorted as possible
Python
Algorithm
Sorting
Peak detection of measured signal
Algorithm
Language Agnostic
Print two-dimensional array in spiral order
Arrays
Algorithm
Language Agnostic
Math
What is the meaning of O( polylog(n) )? In particular, how is polylog(n) defined?
Algorithm
Full Text-Search
Compression
Complexity Theory
Use of for_each on map elements
C++
Algorithm
Stl
Stdmap
Std Pair
Problem: Bob's Sale
Algorithm
How does a sentinel node offer benefits over NULL?
C++
Algorithm
Data Structures
LogLog and HyperLogLog algorithms for counting of large cardinalities
Javascript
Algorithm
Counting
Loglog
Hyperloglog
Finding cartesian product with PHP associative arrays
Php
Algorithm
Associative Array
Cartesian Product
Reason for the number 5381 in the DJB hash function?
Algorithm
Hash
Primes
Why is iterative k-way merge O(nk^2)?
Algorithm
Radix sort vs Counting sort vs Bucket sort. What's the difference?
Algorithm
Sorting
Radix Sort
Bucket Sort
Counting Sort
Efficient calculation of Fibonacci series
Python
Performance
Algorithm
Fibonacci
Differences between time complexity and space complexity?
Algorithm
Complexity Theory
Big O
Faster algorithm to find unique element between two arrays?
Java
Arrays
Algorithm
Which is better: O(n log n) or O(n^2)
Algorithm
Time Complexity
Big O
Complexity Theory
How to find the only number in an array that doesn't occur twice
Java
Arrays
Algorithm
Fast ceiling of an integer division in C / C++
C++
C
Algorithm
Math
Fast way to generate pseudo-random bits with a given probability of 0 or 1 for each bit
C++
C
Algorithm
Random
Bit Manipulation
Problems with using a rough greyscale algorithm?
Python
Algorithm
Python Imaging-Library
Image Conversion
Image Comparison
How do I find the next multiple of 10 of any integer?
C
Algorithm
Math
What is holding genetic programming back?
Algorithm
Genetic Programming
Evolutionary Algorithm
K-means algorithm variation with equal cluster size
Algorithm
Map
Cluster Analysis
K Means
Algorithm to randomly generate an aesthetically-pleasing color palette
Algorithm
Colors
Java, Shifting Elements in an Array
Java
Arrays
Algorithm
Shift
How to delete in a heap data structure?
Algorithm
Data Structures
Heap
How much do two rectangles overlap?
Algorithm
Math
Geometry
Bounding Box
Is Minimum Spanning Tree afraid of negative weights?
Algorithm
Data Structures
Graph
Minimum Spanning-Tree
Parsing one terabyte of text and efficiently counting the number of occurrences of each word
C#
Algorithm
How do I convert an Int to a String in C# without using ToString()?
C#
String
Algorithm
Int