Skip to main content
Filter by
Sorted by
Tagged with
Advice
0 votes
4 replies
73 views

I was solving the algorithm problem: find all unique substrings from the string, using sets. Here is the model solution, but I can't understand what line 6 means. Why does the end go up to length + 1? ...
Ilona's user avatar
  • 21
Advice
0 votes
4 replies
74 views

P(n) = sum_{k=0}^{100} [ p_k * product_{j=0, j≠k}^{100} (n - j)/(k - j) ] this is called a polynomial interpolation formula which gives a streak of 100 prime numbers higher than Euler's n²+n+41 which ...
user avatar
4 votes
1 answer
246 views

I need to add many fractions together. I don't use float because IEEE-754 Double Precision Floating Point has only 53 bits for mantissa thus 53 * log10(2) = 15.954589770191003 accurate decimal digits. ...
Best practices
2 votes
7 replies
141 views

This is related to this question. Basically, I need to add many fractions together. Seems simple enough? Except it isn't simple. I can't use fractions.Fraction class, that thing stupidly does fraction ...
9 votes
2 answers
331 views

With std::ranges::max, it is possible to use a projection as follows std::vector<std::tuple<char,int,double>> v = { {'a',2,1.0}, {'c',1,3.0}, {'b',4,2.0}, {'d',3,4.0} }; auto m = std::...
abcdefg's user avatar
  • 5,589
Advice
0 votes
7 replies
71 views

Let a "branching" operation be an operation that, given a finite sequence of integers, increments and duplicates one element in place. For example: (3,1,4,1,7) → (3,1,5,5,1,7) A tree ...
sitiposit's user avatar
  • 149
Advice
0 votes
31 replies
252 views

Unlike conventional collision detection algorithms (using right-angled triangles), I created an algorithm using the theta value with objects. (Theory, etc., got a little help from the Gemini, but I ...
chickenman1's user avatar
Best practices
0 votes
8 replies
73 views

I have a sampled 1D signal that contains very sharp periodic peaks. The peaks are narrower than the sampling resolution, and the lower part of the signal contains noise. The goal is to estimate the ...
user32361358's user avatar
10 votes
1 answer
641 views

I’m looking at the classic “is binary tree balanced” problem (LeetCode 110 style): Given a binary tree, determine if it is height-balanced. A binary tree is height-balanced if for every node, the ...
FluidMechanics Potential Flows's user avatar
4 votes
1 answer
98 views

I am studying Depth First Search (DFS) on undirected graphs and I am confused about discovery order. I have attached a figure of an undirected graph with DFS discovery (d) and finishing (f) times ...
Mayesha Tasnim's user avatar
1 vote
1 answer
214 views

I was fiddling with the Brainfuck esolang over the past few days, and tried to implement an increment operation on an N-byte-wide integer in big-endian format. Note that I am imposing a structural ...
so8714's user avatar
  • 19
0 votes
0 answers
56 views

I have been following the Cormen algorithm for RB trees, but I have a question regarding deletion, specially in this case: 38 31 41 all the nodes are black and I want to delete 38. After ...
Little's user avatar
  • 3,487
0 votes
1 answer
138 views

I am making a drawing application and i have to show the borders of the pencil. To know where to place the pixels I use a list of integer offsets from the cursor that make up a shape, so the cursor is ...
Gabbinetto's user avatar
Tooling
0 votes
11 replies
122 views

I'm working on a project in which I need to filter out specific strings from an inconsistent API, where the strings are not always what I want. I need to filter out eligibility for different education ...
23emli's user avatar
  • 1
Advice
2 votes
3 replies
57 views

0-1 Knapsack problem is often used as a starting problem to understand dynamic programming. This problem can also be solved using backtracking. Now, backtracking explores all possible subsets and uses ...
Hades's user avatar
  • 11

15 30 50 per page
1
2 3 4 5
…
8099