Skip to main content
The 2024 Developer Survey results are live! See the results

All Questions

Tagged with
2 votes
3 answers
100 views

How to determine an overlapping sequence of words between two texts

In one of our digital assignments, I had asked my students to read an article and write a few things they learned from that article. Students were told that they were supposed to write using their ...
Anita's user avatar
  • 35
3 votes
2 answers
105 views

A more efficient algorithm in finding the number of distinct decompositions a number has using only repdigits

This is a problem from a previous semester that I am trying to upsolve. I am trying to solve a problem involving the total number of ways of decomposing a number using only repdigits. A repdigit is a ...
Lesserrafim's user avatar
0 votes
0 answers
30 views

Calculating a list of voxels within multiple overlapping Axis-Aligned-Bounding-Boxes, without looping over the same space

I have a method that returns a list of voxel coordinates within an AABB. Let's say a voxel is 1x1x1 cm, and a bounding box is 2x2x2, then it will return 8 voxels by looping over the dimensions of the ...
Melvin Brink's user avatar
0 votes
2 answers
60 views

Why is the last digit incorrect in my timing attack password cracker using Python?

I'm working on a timing attack to crack a password using Python. My goal is to measure the time it takes to check each digit of the password and use this information to deduce the correct digits. The ...
r0tten_appl3's user avatar
0 votes
1 answer
67 views

Merge sort algorithm parallelization speed-up

I am doing a theoretical exercise for a class about a theoretical study of parallelizing the mergesort algorithm and the speed-up obtained for different amounts of cores. I am using the following ...
tiredStudent's user avatar
0 votes
1 answer
89 views

How to make this Python function even faster, lists processing

I was doing a Hackerrank question (I already finished that test, I am just asking because I am curious). Most of test cases were successful but a few said that it took too long, so I had to optimize ...
Andres Masis's user avatar
1 vote
1 answer
86 views

How do I express the speedup of the merge sort algorithm when I parallelize the divide step?

I am trying to solve the following exercise: Consider the following recursive mergesort algorithm (another classic divide and conquer algorithm). Mergesort was first described by John Von Neumann in ...
tiredStudent's user avatar
2 votes
1 answer
78 views

Improving performance of a reachable vertices algorithm applied on a 3 dimensional graph

Preamble and goals I have a working algorithm (and working code) for a custom reachable vertices algorithm with memoization on a 3 dimensional graph, but it is not performant enough. My goal is to ...
hexaquark's user avatar
  • 921
-1 votes
1 answer
72 views

Find words with only one letter difference from a list of words [closed]

I'm trying to find all the letters in a list that differ from each other by word. I then output them into an array. The trouble is it takes my current code 17 seconds for 18, 000 words and I trying to ...
Gijoel2001's user avatar
0 votes
2 answers
67 views

Find shortest path between two nodes, all paths are equal to one

Is Dijkstra's algorithm the most suitable for finding the shortest distance between two nodes, where all of the paths in the graph are equal to 1. If not what is a more time efficient way of ...
Sveti Drogaria's user avatar
0 votes
0 answers
86 views

How to make Matching Algorithm more efficent in Python

I've developed a Python script to calculate match scores between users based on their locations. The script generates combinations of users, calculates the average weight for each combination, ...
Joseph Adam's user avatar
1 vote
0 answers
52 views

When is a Range Query Sparse Table useful compared to a Range Query Segment Tree?

Let's look at the complexities of the <preprocess, query, update an element> operations. Let's denote n the size of the initial array and q the number of queries. Sparse table <O(nlogn) , O(...
FluidMechanics Potential Flows's user avatar
1 vote
2 answers
254 views

Counting Nested Ranges

With N ranges of the form [start, end] (both endpoints inclusive), I want to find, for each range, how many (other) ranges contain it and how many ranges it contains (are contained by it). tl;dr count ...
user24044002's user avatar
0 votes
1 answer
103 views

C++ : Is there an objective universal way to compare the speed of iterative algorithms?

I have a couple of iterative algorithms written in C++ to solve the same problem. When running these algorithms on my machine for very large input sets, it is quite easy to classify them based on the ...
cosmicPikachu's user avatar
0 votes
0 answers
15 views

Approach to display links by role

Imagine you have a navbar with over 50 links (including dropdowns), and there are about 7 user roles within the app. I won't focus on any specific programming language, but rather on the most ...
Marcelo Alarcon's user avatar

15 30 50 per page
1
2 3 4 5
206