Questions tagged [algorithm]
An algorithm is a sequence of well-defined steps that defines an abstract solution to a problem. Use this tag when your issue is related to algorithm design.
algorithm
121,039
questions
0
votes
0
answers
8
views
DEG Analysis using Limma on DSP GeoMx Data: Handling Multiple ROIs per Core
I am performing differential expression analysis using the limma package on DSP GeoMx data, and I have a question regarding the handling of multiple ROIs per core. Below is a snippet of my sample ...
0
votes
1
answer
20
views
Fast way of detecting outliers in 2D space
I have hundreds of millions of point clouds like the following:
I want to remove outliers 1, 2, 4, 5, 6, 7. The safest bet is to build a minimum spanning tree connecting all the points and remove ...
-1
votes
0
answers
15
views
How to create an algorithm with melody and chords as input, and tight parallel 3 part harmony as output [closed]
After not finding the app I'm looking for and speaking to a friend who programs:
I'm looking to develop algorithmic rules which can be used to program an app such that you input a melody and ...
0
votes
1
answer
64
views
Finding minimum value in given range efficiently
I have function that takes a number n that represents number of servers and another parameter represents a list of requests
Initially servers will hold values 0 of size n.
For each request, requests[i]...
0
votes
0
answers
21
views
Algorithm help: given n sets of integers and a target integer, find a set of one element from each set that adds to the target integer
I have multiple sets of integers, let's call them K_1 through K_N. Each set is finite and not necessarily the same size. I have a target integer, C.
Is there a way to select one element from each ...
0
votes
1
answer
29
views
Checking a candidate majority element: Does my simplification work with all cases?
Here are the details of the problem:
Given a sorted array arr of N elements.
A majority element in an array of size N is an element that appears more than N/2 times.
The task is to write a function ...
-1
votes
0
answers
29
views
According to which algorithm is the schedule of the 2018 FIDE World Chess Candidates Tournament created (if any)?
Update
The Berger table for n = 7 can be constructed as follows (in R).
# number of players from 0, uneven.
# number of venues.
# step is relative prime to n.
n <- 7
nv <- (n + 1) / 2
white <...
-5
votes
0
answers
20
views
ski rental problem with change in purchase price every day [closed]
So im struggling to solve this problem:
Consider a variation of the ski rental problem where the purchase price decreases each day by half the rental price. Assume the rental price is 1 per day.
The ...
1
vote
1
answer
43
views
Finding the subsequence with the least median given a size K and an array of length N
I have been struggling the past month with this problem that was given to us on our course while I was upsolving it. The task is to find the window of size K with the least median in an array of ...
1
vote
1
answer
57
views
Why is this algorithm O(n*n) - Manacher algorithm implementation?
So I was recently doing leetcode problem number 5 - longest palindromic substring, which outputs the longest palindromic substring out of a string. I have studied Manacher's algorithm but I didn't ...
-4
votes
0
answers
21
views
Association Rule Mining support count where there are duplicated items [closed]
When I learned about Association Rule Mining, the example was similar to https://www.geeksforgeeks.org/frequent-item-set-in-data-set-association-rule-mining/ and Frequent Itemsets & Association ...
-1
votes
0
answers
46
views
Swift: Complex matching algorithm needed
I have a problem implementing an algorithm to match invoices with transactions. So far the matching works quite well but from the code with the comment:
// Search for a transaction that can cover ...
1
vote
1
answer
104
views
+50
Permutation summation in Pandas dataframe growing super exponentially
I have a pandas dataframe that looks like
import pandas as pd
data = {
"Race_ID": [2,2,2,2,2,5,5,5,5,5,5],
"Student_ID": [1,2,3,4,5,9,10,2,3,6,5],
"theta": [8,9,2,...
0
votes
0
answers
43
views
Design a Data structure ~(simple rate limiter) [closed]
I'm studying DSA for my interviews && university exams and kinda stuck right now.
There is a problem statement: given n(limit of request) and m(window time), design a data structure that ...
1
vote
2
answers
68
views
How to sort an array by only being able to swap an element with another element two positions ahead (i+2)?
I have an array of integers that I need to sort. However, the only operation allowed is to swap an element at index i with the element at index i+2. This means traditional sorting algorithms like ...