Skip to content Skip to sidebar Skip to footer
Showing posts with the label Algorithm

Count Number Of 0s From [1,2,....num]

We are given a large number 'num', which can have upto 10^4 digits ,( num Solution 1: from… Read more Count Number Of 0s From [1,2,....num]

All Unique Paths In A Directed Acyclic Graph, In Randomized Order, Via Python Generator?

I have a Directed Acyclic Graph (DAG), which consists of layers, with two subsequent layers being c… Read more All Unique Paths In A Directed Acyclic Graph, In Randomized Order, Via Python Generator?

How Do I Make My Implementation Of Greedy Set Cover Faster?

I came up with the following implementation for the Greedy Set Cover after much discussion regardin… Read more How Do I Make My Implementation Of Greedy Set Cover Faster?

How To Find All The Unique Substrings Of A Very Long String?

I have a very long string. I want to find all the unique substrings of this string. I tried to writ… Read more How To Find All The Unique Substrings Of A Very Long String?

Sine Wave That Exponentialy Changes Between Frequencies F1 And F2 At Given Time/amount Of Samples

I'm trying to implement Python method that generates sine wave, which ramps up between two freq… Read more Sine Wave That Exponentialy Changes Between Frequencies F1 And F2 At Given Time/amount Of Samples

How To Randomize The Order Of Elements Of A List While Making Sure No Consecutive Values Are Equal?

I have a python list of strings, let's say: elems = ['A', 'B', 'C', … Read more How To Randomize The Order Of Elements Of A List While Making Sure No Consecutive Values Are Equal?

Algorithm For Arbitrary Number Of Nested For Loops

I am trying to figure out an algorithm to generalise my code for an arbitrary integer value of a pa… Read more Algorithm For Arbitrary Number Of Nested For Loops

Why Does This `else` Block Work Yet It Is Not On The Same Level As The `if` Case?

This code runs pretty well and generates the wanted list of prime numbers. But the else block that … Read more Why Does This `else` Block Work Yet It Is Not On The Same Level As The `if` Case?

How To Produce An Ordered Sequence Of Vertices Of Polygon From A Discretized Cellular Representation Of Polygon

Here is the cellular representation of polygon shown:- Here is the extracted polygon shown. We ar… Read more How To Produce An Ordered Sequence Of Vertices Of Polygon From A Discretized Cellular Representation Of Polygon

Algorithm For Generating A 3d Hilbert Space-filling Curve In Python

I'd like to map points in a RGB color cube to a one-dimensional list in Python, in a way that m… Read more Algorithm For Generating A 3d Hilbert Space-filling Curve In Python

Longest Common Subsequence, Python, Greedy

I have already submitted a draft code for the LCS problem of two sequences. I made bad mistakes try… Read more Longest Common Subsequence, Python, Greedy

Uses Of Self Referencing Lists

I know it is possible to create a self referencing list in languages like Python: >>> my_l… Read more Uses Of Self Referencing Lists

How Can I Order A List Of Connections

I currently have a list of connections stored in a list where each connection is a directed link th… Read more How Can I Order A List Of Connections

Robust Algorithm To Detect Uneven Illumination In Images [detection Only Needed]

One of the biggest challenges in tesseract OCR text recognition is the uneven illumination of image… Read more Robust Algorithm To Detect Uneven Illumination In Images [detection Only Needed]

Object Tracking In Real Time Via Opencv And Python

I'm looking for good algorithm to do object tracking in real time. the best one I found so far … Read more Object Tracking In Real Time Via Opencv And Python

How To Extract All Coordinates From A Dxf File

Ive got a dxf file https://filebin.net/7l8izrv2js7doicc/5holes-8x8.dxf?t=9ro7k928 (download and nam… Read more How To Extract All Coordinates From A Dxf File

Algorithm For Generating A Tree Decomposition

I want to construct a tree decomposition: http://en.wikipedia.org/wiki/Tree_decomposition and I hav… Read more Algorithm For Generating A Tree Decomposition

Implementing The Prolog Unification Algorithm In Python? Backtracking

I'm trying to implement Unification, but having problems.. already got dozen of examples,but al… Read more Implementing The Prolog Unification Algorithm In Python? Backtracking

Is This An Optimal Prime Generator?

Is this in any way an optimal solution for finding primes? I am not trying to add every optimizatio… Read more Is This An Optimal Prime Generator?

Kosaraju's Algorithm For Finding Sccs But Keep Track Of Edge Between Sccs?

I currently have a working implementation of Kosaraji's algorithm that, given a directed graph … Read more Kosaraju's Algorithm For Finding Sccs But Keep Track Of Edge Between Sccs?