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

How To Find The Longest Smallest Path?

A frog wants to cross a river. There are 3 stones in the river she can jump to. She wants to choos… Read more How To Find The Longest Smallest Path?

How To Extract Specific Numbers From Numpy Arrays Based On The Repetition Of Numbers

I have two numpy arrays and want to extract some specific parts of them. These arrays are: arr_A=np… Read more How To Extract Specific Numbers From Numpy Arrays Based On The Repetition Of Numbers

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?

Generating All The Combinations Of Two Lists And Output Them One By One In Python

I have two lists [1, 3, 4] [7, 8] I want to generate all the combinations of two list starting fro… Read more Generating All The Combinations Of Two Lists And Output Them One By One In Python

How To Improve Permutation Algorithm Efficiency With Python

I have a file that contains just over 100,000 words. What I have to do is run through every 5 lette… Read more How To Improve Permutation Algorithm Efficiency With Python

The Algorithm For Dividing The Range Of Subnet

There is a interesting algorithm, wrt dividing the range of subnet. I have a subnet,such as 192.168… Read more The Algorithm For Dividing The Range Of Subnet

Python (football Games Algorithm Troubles)

I am trying to write algorithm for football group stage. for example: i have 4 teams in the stage. … Read more Python (football Games Algorithm Troubles)

Add Values From Two Dictionaries

dict1 = {a: 5, b: 7} dict2 = {a: 3, c: 1} result {a:8, b:7, c:1} How can I get the result? Soluti… Read more Add Values From Two Dictionaries

Fast Algorithm To Factorize All Numbers Up To A Given Number

I am looking for an algorithm that could factorize numbers based on numbers it already factorized. … Read more Fast Algorithm To Factorize All Numbers Up To A Given Number

Two Sorted Arrays, Sum Of 2 Elements Equal A Certain Number

I was wondering if I could get some help. I want to find an algorithm that is THETA(n) or linear ti… Read more Two Sorted Arrays, Sum Of 2 Elements Equal A Certain Number

Given Two Lists Of 2d Points, How To Find The Closest Point In The 2nd List For Every Point In The 1st List?

I have two large numpy arrays of randomly sorted 2d points, let's say they're A and B. What… Read more Given Two Lists Of 2d Points, How To Find The Closest Point In The 2nd List For Every Point In The 1st List?

Implement A Script In A Function. Some Suggestions?

first of all, i am quite new in Python (an programming area) but i wish to learn and convert a func… Read more Implement A Script In A Function. Some Suggestions?

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

C# Split A List Into All Combinations Of N Groups - Code Migration From Python

There is a great implementation of the algorithm I am after here (by @lazy dog). However, I need t… Read more C# Split A List Into All Combinations Of N Groups - Code Migration From Python

How Do I Reduce The Time Complexity Of This Code Snippet In Python?

I have a compare function here which compares 2 4-digit numbers (non-repeating digits) and gives x … Read more How Do I Reduce The Time Complexity Of This Code Snippet In Python?

How To Find 2 To The Power Of An Insanely Big Number Modulo 10^9

I have an excessively big number (1500+) digits and I need to find 2 ** that number modulo 1_000_00… Read more How To Find 2 To The Power Of An Insanely Big Number Modulo 10^9

How To Find Adjacent Lines On A Regular 3d Grid In Python

I have the coordinate of a bunch of points and want to create surfaces out of them in a python pack… Read more How To Find Adjacent Lines On A Regular 3d Grid In Python

How To Improve This Adaptive Trapezoidal Rule?

I have attempted an exercise from the computational physics written by Newman and written the follo… Read more How To Improve This Adaptive Trapezoidal Rule?

How To Get All Intersections Of Sets In Python Fast

I would like to compute all (different) intersections of a collection of finite sets of integers (h… Read more How To Get All Intersections Of Sets In Python Fast

Compute Entropy Of Different File Extensions To Find Randomness Of Data?

I have different file types which includes JPEG and jpg ,#mp3 ,#GIF,#MP4,#FLV, M4V ,exe, zip etc. … Read more Compute Entropy Of Different File Extensions To Find Randomness Of Data?