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,111
questions
0
votes
0
answers
21
views
Location Stoppages Time
I am working on live location tracking software.The End users have a motorcycle which they will perform tasks they are assigned to.Based on the mobile coordinates they send to backend server, I am ...
0
votes
1
answer
77
views
Evaluating Improvements in C Program Using Hash Tables: A Beginner's Perspective
I'm new to C programming and I'm trying to understand the differences between two programs that check for duplicate elements in an array using hash tables with the uthash library. I've noticed some ...
5
votes
3
answers
218
views
Multiplication of huge massive of numbers in python
I'm working on a small python program for myself and I need an algorithm for fast multiplication of a huge array with numbers (over 660 000 numbers, each is 9 digits). The result number is over 4 ...
-1
votes
2
answers
141
views
Finding minimum pairs from given input
I have a string s of length n made of only 3 characters 0, 1, and !, and two numbers provided as x and y
Now I have to replace ! with 0 or 1
Then count number of subsequences 01 say count1 and also 10 ...
0
votes
2
answers
76
views
Generate number based on time.Now() and some time ago [closed]
Do you happen to know any way to "calculate" some number based on time that is "contant" for following condition.
Let's say now it time.Now() and I need for example number that is ...
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 ...
3
votes
0
answers
88
views
Is there a curve-triangle intersection algorithm?
The problem of calculating the intersection between a ray and a triangle is well-known. For this there exists e.g. the Möller-Trumbore intersection algorithm.
For my application I need an algorithm ...
1
vote
1
answer
44
views
Find the right interval in a sorted arrary with duplicates given an input
I'm struggling with an array problem which I am not quite sure how to solve with binary search properly.
Say x is a sorted array, with duplicated values. Given a x_input, find the index of the two ...
2
votes
3
answers
84
views
Find number of redundant edges in components of a graph
I'm trying to solve problem 1319 on Leetcode, which is as follows:
There are n computers numbered from 0 to n - 1 connected by ethernet cables connections forming a network where connections[i] = [ai,...
-2
votes
0
answers
113
views
Remove unncessary parentheses in Java
I am trying to remove unncessary parentheses in an expression. So far, my code handles most of the use cases such as,
Expression: 2 + (3 / -5) Result: 2 + (3 / -5)
Expression: x+(y+z)+(t+(v+w)) Result:...
0
votes
2
answers
90
views
Why does my Delaunay Triangulation using the Bowyer Watson algorithm not work?
I am implementing delaunay triangulation on a random set generated points, making use of the Bowyer Watson algorithm.
I seem to be running into a issue where the output seems to be generating way too ...
0
votes
0
answers
37
views
Finding Top Users with Common Records in a Growing Dataset
I’m working on a project where I have a large dataset containing billions of records. Each user can have one or more records, and each record can be associated with multiple users.
Given a specific ...
3
votes
2
answers
91
views
What is wrong in my solution for Leetcode's RansomNote
I am working on the Leetcode problem 383. Ransom Note:
Given two strings ransomNote and magazine, return true if ransomNote can be constructed by using the letters from magazine and false otherwise.
...
4
votes
0
answers
205
views
Finding repeating sequences with less than O(n^2) time complexity
Is it possible to find repeating sequences of any length (without complete overlaps) with an average time complexity less than O(n^2) ?
For example, take a string like this:
0 1 2 ...
1
vote
2
answers
167
views
Smallest element after xor
Starting with array of N positive integers, support Q queries. Each query contains a positive integer i. To answer the query, replace each element of the array with the result of xoring it with i, ...