menu

Recent questions tagged algorithms

3 votes
1 answer
What algorithms exist for streaming network data? Implemented an application for processing packet headers, the meaning is this: in one interface eth0 enter the data from the gray network change and go out of eth1, the ...
by jajabin
asked Sep 24, 2021
0 votes
6 answers
image
How to find the shortest path with the minimum number of turns (turns in priority)? How to find the shortest path with the minimum number of turns ? In this example, 1 is the orange wall and 0 is the black void: The red line is how the path should b ...
by allex997
asked Sep 24, 2021
1 vote
1 answer
Is it possible to create a 3D scene from a video? Is there even such an idea? That is, using a neural network to recreate the entire scene from the video sequence, for example the scene where the two are talking in the ...
1 vote
2 answers
How to implement a depth search without recursion and if there are a lot of ring links? There is a two-dimensional array and a finite number of cells next to the same data value. You have to go around them ...
3 votes
1 answer
A quick way to find all possible variations of the array values What are some ways? Good afternoon, I have an array of 3 elements I want to get all possible combinations from this array: массив: 'A','B','C' Комбинации:ABCA BA CB C A B C The trouble i ...
by MasterCopipaster
asked Sep 22, 2021
1 vote
2 answers
How do I go through the array as long as the dates match? I have objects that have record times. There are a lot of objects, so I think it is resource-consuming to loop through all the records. Actually, my question is: how to ...
by Oposum
asked Sep 21, 2021
4 votes
1 answer
How do I calculate the perspectiveTransform by 3 points? There is a photo from the camera (calibrated by means of OpenCV) of the object. I can only find 3 points on it (no options). Let's call this the "original" position. ...
by Kalombyr
asked Sep 20, 2021
1 vote
1 answer
How to refine the algorithm? Good afternoon. I decided to write an algorithm for the game in it, so that the bot always wins, but when you start the game with the number 8 bot loses. How to refine i ...
by anton206060
asked Sep 20, 2021
1 vote
1 answer
What sorting algorithm is presented? The problem is from the Yandex contest. There is a function - a generator, also encrypted, uses a sorting algorithm. I need to find a bug in it. But I can't even underst ...
by alexbuki
asked Sep 20, 2021
5 votes
3 answers
How do I calculate the optimal suppliers and quantities to order? There is a conditional array with vendor prices and quantities in stock, the first element in the array is priceBreak where the key is the minimum quantity to order, and ...
by konstantin_obukhov
asked Sep 20, 2021
1 vote
2 answers
How can we tell if a vector is not pointing toward the center of coordinates? I have a polygon structure, for it I need to calculate the normal. To do this, I choose 2 random vectors and vectorically multiply them. Since I choose 2 vectors at rand ...
by BitNeBolt
asked Sep 20, 2021
1 vote
2 answers
How to improve the performance of js code? Good day to you, Hubrowites! I recently started studying at codewars and had a problem with the speed of code execution. There is a code: function partsSums(ls) { ls ...
by MisticX
asked Sep 20, 2021
1 vote
1 answer
A multiprocessor programming problem in c? Hello all, the task is to find the longest sequence wrapped in side brackets - "< " and ">". That is, if there are sequences of <a> и <bbb> the answe ...
by dotruger37
asked Sep 19, 2021
1 vote
2 answers
How can I tell if there is a pattern break? We have a canvas with a shape on it. We need an algorithm to determine if the figure has one object or several. Where can I find such an algorithm? Thanks ...
by gena-tile
asked Sep 19, 2021
3 votes
1 answer
How can I improve the algorithm so that it works faster? There is an algorithm for finding the next larger number in permutations of that number. But it is not fast enough. How can it be improved? Codeimport itertools def ...
by kitscribe
asked Sep 19, 2021
1 vote
1 answer
Where is the error in the permutation algorithm? You need to write a function that returns the closest number to the number passed to it by performing permutations. My code does not pass all the tests. Where did I go ...
by kitscribe
asked Sep 19, 2021
1 vote
2 answers
What is this function? What is this C++ function? What is the name of the algorithm? void SortArr(int arr, int n) { for (int startIndex = 0; startIndex < n - 1; ++startIndex) { ...
by NQUARE
asked Sep 18, 2021
1 vote
3 answers
Is there an encoding algorithm that does not allow 3-6 identical values in a row? Hello! Two devices are communicating via the com port. Let it be an Arduino, because I test with them. We need to somehow separate the packet from the packet, provided ...
2 votes
1 answer
How do I find all the points that are equidistant from the data using the Manhattan distance? Hi, let's cut to the chase. Manhattan distance formula: abs(x1 - x2) + abs(y1 - y2), where x1, y1, x2, y2 are the coordinates of the points between which the distance ...
by RomirosR
asked Sep 18, 2021