Questions tagged [algorithm]

An algorithm is a sequence of well-defined steps that define an abstract solution to a problem. Use this tag when your issue is related to algorithm design.

Filter by
Sorted by
Tagged with
1 vote
0 answers
12 views

Nodejs Websocket pulling new data from InfluxDB

I have a nodejs server with websocket which is pulling the new data from InfluxDB and send it to client. The piece of code is this: ...
KunLun's user avatar
  • 111
0 votes
0 answers
50 views

Summing Duplicates Across Sublists in a Nested List [closed]

I hope my message finds you well. I am seeking your expertise and feedback on a specific issue I have encountered in the repeat_sum function within the codebase. ...
XM01 - stands with Palestine's user avatar
0 votes
0 answers
51 views

Is this iterative inorder traversal algorithm well-known?

I was concerned about the approach in Morris traversal algorithm and came up with simpler solution that uses parent pointers in nodes. The constraints were following: Time Complexity: O(n) Space ...
Max's user avatar
  • 1
0 votes
1 answer
76 views

Move timestamp to the next Monday 10:01 AM

I've been battling ChatGPT for hours now and can't get satisfied with this simple algorithm in TypeScript. These two (hopefully correct) TypeScript+ReactNative solutions should move the timestamp ...
Slazer's user avatar
  • 101
7 votes
2 answers
2k views

Gaussian elimination algorithm in C++

Given: j-g-h-i=0 a+b-c-j=0 c+i-d-e=0 e+g-f=0 And known: a=10 b=7 d=3 e=2 f=3 j=14 I want to solve this (or similar equations) ...
Tobias Grothe's user avatar
3 votes
1 answer
89 views

Pentomino solver in Python

When I was a child, I used to play Ubongo board game, recently I discovered Pentomino puzzle and I wanted to create a custom solver in python for it. Here is what I got: ...
Riomare's user avatar
  • 31
0 votes
1 answer
65 views

HackerRank Algorithm Problem: Climbing the Leaderboard (Python)

Here is the Hackerrank problem which is related to dense ranking and below is my solution which didn't pass the time limit cases. Any better way to optimize this? ...
peternish's user avatar
2 votes
1 answer
47 views

Creating Worst-Case Scenario for QuickSort using Middle Pivot in Java

I've implemented a solution to generate the worst-case scenario for QuickSort using the middle pivot strategy in Java. The goal is to rearrange an input array to produce the worst performance during ...
Lydia Yuan's user avatar
0 votes
3 answers
68 views

another Merge Sort

I've tried to implement merge sort in c with varying degrees of success, one was correctly sorting the array but leaking memory, one was neither sorting the array and leaking memory. The following was ...
Voiceroy's user avatar
  • 103
1 vote
3 answers
94 views

Another ATMs cash-out (denomination) algorithm in Java

Related to this question and this answer, I would like to have a second review from you on a modified version. The problem I tried to solve Some kind of "Minimum count of numbers required from ...
Tobias Grothe's user avatar
2 votes
2 answers
294 views

Another cash machine with special bill values in Java

Task: An ATM dispenses banknotes with the following values/denominations: {5, 30, 35, 40, 150, 200}. The user should be able to repeatedly enter an amount divisible by 5 without leaving a remainder. ...
Tobias Grothe's user avatar
0 votes
0 answers
16 views

Login panel .feature (gherkin) file

I think many days ago, I randomly got introduced to cucumber developement, And it seemed like a conventional and interesting principle of software development. At this very time, I'm concentrating on ...
KhodeNima's user avatar
  • 167
0 votes
0 answers
17 views

Object-based Radix Sort via an Iteratee

I recently finished implementing a radix sort for objects where either one of the keys is numeric, or can be expressed numerically via an iteratee. ...
Christopher Fimbel's user avatar
4 votes
0 answers
123 views

Find the longest "common sequence" in two lists

In short, the algorithm must find the longest sequence that joins together common sequences from two lists (a more formal specification is given in the code's header). The lists are assumed to contain ...
user266319's user avatar
4 votes
1 answer
1k views

Determine if it is EU summer time in Java

I wanted to write a utility method for learning purposes to determine if a given date (year, month and day) falls within EU summer time or not, without using any of the Java library methods. Is here ...
Tobias Grothe's user avatar

15 30 50 per page
1
2 3 4 5
337