Skip to main content
Search type Search syntax
Tags [tag]
Exact "words here"
Author user:1234
user:me (yours)
Score score:3 (3+)
score:0 (none)
Answers answers:3 (3+)
answers:0 (none)
isaccepted:yes
hasaccepted:no
inquestion:1234
Views views:250
Code code:"if (foo != bar)"
Sections title:apples
body:"apples oranges"
URL url:"*.example.com"
Saves in:saves
Status closed:yes
duplicate:no
migrated:no
wiki:no
Types is:question
is:answer
Exclude -[tag]
-apples
For more details on advanced search visit our help page
Results tagged with
Search options not deleted user 140805

Performance is a subset of Optimization: performance is the goal when you want the execution time of your program or routine to be optimal.

5 votes
2 answers
2k views

Nelder-Mead algorithm in C#

I am currently learning C# since the last week. I have little to no prior experience with any of the C family of languages. I implemented the Nelder-Mead algorithm for numerical optimisation of a fun …
JAD's user avatar
  • 2,919
2 votes
Accepted

Nelder-Mead algorithm in C#

With advancing insight I have found a few issues with the code. Check for convergence doesn't work properly // Check for convergence if (functionValues[N] - functionValues[0] < 1e-9) …
JAD's user avatar
  • 2,919
0 votes
Accepted

Correctness and Performance of graph plotting on R

The plot looks about right with the data, and I see no egrerious errors in your code. I do have a few remarks. In r it's unnecessary to end your lines with a semi-colon, and most styleguides advise …
JAD's user avatar
  • 2,919
5 votes
1 answer
546 views

Incremental Sieve of Eratosthenes Generator

So I was fiddling around with the Euler challenges. One of the things they mentioned in their discussions of the solutions is the Sieve of Eratosthenes and that you can only use it when you know an up …
JAD's user avatar
  • 2,919
1 vote
Accepted

Codility's stonewall 100% solution - different paths such as if,else if,etc, do the same thing

Some of these branches can be eliminated. Let's see: if (heightsStack.Count > 0) { if (heightsStack.Peek() < H[height]) { blocksCounter++; heightsStack.Push(H[height]); } } else { blo …
JAD's user avatar
  • 2,919
6 votes

Singly Linked List implementation C++

Length You provide a method to calculate the length of the list. But from the moment of creation of the list, you should be able to track this length. If you add a private counter, increment it whene …
JAD's user avatar
  • 2,919
1 vote
Accepted

MaxProductOfThree in C#

This looks like a good attempt. Let's first start assuming we only have to deal with positive values. private int getProductOfMaximalsForMoreThanTwoElements( List<int> B) { int max1 = B.Max(); …
JAD's user avatar
  • 2,919
5 votes

Find the largest sum of any slice inside an array

Two minor remarks: For consistency sake, this accumulator = maxLastPair > accumulator + addend ? maxLastPair : accumulator + addend; can be implemented similar to the other statements as accumu …
JAD's user avatar
  • 2,919
7 votes
Accepted

LeetCode: Group Anagrams C#

Deriving from IEqualityComparer versus EqualityComparer. The MSDN docs say the following: We recommend that you derive from the EqualityComparer class instead of implementing the IEqualityCompare …
JAD's user avatar
  • 2,919