Skip to main content
The 2024 Developer Survey results are live! See the results

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.

0 votes
0 answers
7 views

How to distinguish a machine learning algorithm and a "normal" ones?

i'm working on my thesis where my colleague is using ML models, and im sticked with change point detection models but not ML. (ive seen SVM could be used for CPD). What i have to do is to understand ...
mosenco's user avatar
  • 93
1 vote
1 answer
21 views

Maximizing sum of signed numbers by not skipping more than one consecutive value: DP goes wrong

I am trying to solve this code challenge: A user maintains a list of negative and positive ratings for movies in a collection. The user wants to choose some subsequence of movies from the collection ...
R M's user avatar
  • 11
0 votes
0 answers
8 views

Traverse a graph with multiple stops from a starting point? [duplicate]

I have an undirected weighted graph I need to traverse from X node to a list of nodes. The list is unordered by default, meaning that the order of which nodes are traversed is not important. What's ...
hesoyam's user avatar
0 votes
0 answers
23 views

The model(DecisionTreeClassifier) gives wrong results

I'm taking a machine learning course with an assignment to implement a fit method for DecisionTreeClassifier. Here's my code: import numpy as np import pandas as pd class MyTreeClf: def __init__(...
Kibar Jafarguliyev's user avatar
-7 votes
1 answer
52 views

WiggleSort: giving wrong output? [closed]

I am trying to solve LeetCode problem 324. Wiggle Sort II: Given an integer array nums, reorder it such that nums[0] < nums[1] > nums[2] < nums[3].... You may assume the input array always ...
ttait1's user avatar
  • 1
1 vote
3 answers
87 views

Fast integer sqrt using Math.Sqrt

I'm trying to calculate the square root of integer values. It doesn't need to be very accurate, but it should be fast and deterministic across platforms. I'm using this for a RTS game with lockstep ...
Ollhak's user avatar
  • 93
0 votes
0 answers
47 views

How can I estimate the difference in performance of a HashMap lookup vs List iteration in Kotlin?

I am working on an application that needs to map pdf documents to corresponding json data files (see: Kotlin data structure for efficient lookup of nested data for more details). In trying to ...
pbuchheit's user avatar
  • 1,663
-1 votes
0 answers
42 views

What is the time complexity of list1==list2 operation in Python? [duplicate]

It was my understanding that a condition equating operation would always be O(1) as we are simply checking if LHS is same as RHS. But this scenario got me thinking. if list1 == list2: print("Hi&...
Gl1tch1e's user avatar
0 votes
1 answer
42 views

Kotlin data structure for efficient lookup of nested data

I am currently working on an application that needs to create a mapping between document pdfs and corresponding JSON data files. The files are coming from a third party so I have no control over their ...
pbuchheit's user avatar
  • 1,663
0 votes
2 answers
56 views

How is my algorithm for stock span problem incorrect?

The question : The stock span problem is a financial problem where we have a series of n daily price quotes for a stock and we need to calculate the span of stocks price for all n days. The span Si of ...
newLearner's user avatar
-1 votes
0 answers
22 views

What should I focus while learning DSA? [closed]

So basically I am learning DSA for the first time and I dont want to overlearn or learn things that aren't neccessary. Can anyone tell me what I should focus on? DSA learning I am learning quick union ...
AbdulRehman Rizwan's user avatar
-8 votes
0 answers
42 views

Did Everyone know about Netflix game downloading algorithm on IOS? [closed]

We try to build a Games centre App that allow user can download game from our app. but in IOS we can't download directly like Andiron so try the other way like following Netflix game downloading flow ...
Reaksmey soriya's user avatar
0 votes
1 answer
63 views

How to store row-position in a database?

I am looking to emulate a feature in Excel/Google Sheets where there is a table of data, but someone may move a row up or down. Here is an example of the interaction: My first thought as to how to ...
David542's user avatar
  • 109k
0 votes
2 answers
91 views

Finding if strings can be anagrams

I have String s1 and String s2. I want to check whether it is possible to make s1 an anagram of s2 by removing a single character zero or more times from s1, and removing a single character zero or ...
Sid's user avatar
  • 87
-1 votes
0 answers
16 views

Cloud sim/cloud analyst

LB Policy I have implemented more than 5 algorithms but only default 3 algo is showing up on the option.How to fix it?(Honey bee etc ) Also mention through code in constants.java How to fix this issue ...
SRIDEEP SARKAR's user avatar

15 30 50 per page