Click here to Skip to main content
14,970,270 members
Everything / General Programming / Algorithms

Algorithms

algorithm

Great Reads

by Arthur V. Ratz
In this article we'll demonstrate the implementation of k-means clustering algorithm to produce recommendations.
by Dmitriy Gakh
Development in C# without care of resource consumption can lead to overloading the system. This article describes a case with large waste of memory and CPU time and how to avoid it.
by jurhas
A small simulator for a 6 axis articulated robot
by Arthur V. Ratz
This article demonstrates the development of code in C# implementing famous k-means clustering algorithm to perform graphical raster image segmentation.

Latest Articles

by aroman
In this post I implement a Density Matrix Renormalization Group program.
by Peter Occil
Has many ways applications can sample using an underlying (pseudo-)random number generator and includes pseudocode for many of them.
by Sergey L. Gladkiy
In this article I’ll explain how to perform the alignment based on the face landmarks the detector has found.
by The Sun God
Welcome to our Comparison on Sorting Algorithms Article. Here, we'll be comparing the various sorting Algorithms out there on the basic of several factors.

All Articles

Sort by Score

Algorithms 

Please Sign up or sign in to vote.
25 Dec 2016
Arthur V. Ratz
In this article we'll demonstrate the implementation of k-means clustering algorithm to produce recommendations.
Please Sign up or sign in to vote.
28 Aug 2015
Dmitriy Gakh
Development in C# without care of resource consumption can lead to overloading the system. This article describes a case with large waste of memory and CPU time and how to avoid it.
Please Sign up or sign in to vote.
29 Aug 2017
Arthur V. Ratz
This article demonstrates the development of code in C# implementing famous k-means clustering algorithm to perform graphical raster image segmentation.
Please Sign up or sign in to vote.
26 Apr 2018
Mahsa Hassankashi
Best practice for opinion and Text Mining based on Naïve Bayesian Classifier.
Please Sign up or sign in to vote.
8 Apr 2020
Gunnar S
Implementation of the Poisson Cumulative Distribution function for large Lambdas
Please Sign up or sign in to vote.
7 Sep 2010
Colin Vella
This article presents an algorithm and data structures to implement auto-tiling as seen in RPG Maker, the Starcraft level editor, etc.
Please Sign up or sign in to vote.
17 Feb 2015
DrABELL
Educational software package for Microsoft Windows® 7/8 contains “5-in-1” School Math Calculators and Equation Solvers intended for students and educators
Please Sign up or sign in to vote.
6 Sep 2016
George Swan
An articial life algorithm that attempts to solve a problem by flying a swarm of entities through a range of possible solutions where each entity is guided by the performance of other members of the swarm
Please Sign up or sign in to vote.
1 Jun 2018
Alvaro Carballo Garcia
Comprehensive unit parsing library
Please Sign up or sign in to vote.
27 Nov 2017
Miguel Diaz Kusztrich
An infinite set of biological shape fractals in the complex plain
Please Sign up or sign in to vote.
13 Oct 2013
Member 9294701
A simple, portable yet efficient Quicksort implementation in C
Please Sign up or sign in to vote.
22 Apr 2016
Darryl Bryk
1 alternative  
C# code for a low-pass Butterworth filter is presented
Please Sign up or sign in to vote.
9 Sep 2018
Philipp Sch
Finding a fundamental Cycle Set forming a complete basis to enumerate all cycles of a given undirected graph
Please Sign up or sign in to vote.
30 Dec 2018
Arthur V. Ratz
In this article, we will demonstrate how to compute full SVD of a given matrix A and discuss about the code in C++11 implementing the full SVD computation by using simple iteration and Jordan-Gaussian methods.
Please Sign up or sign in to vote.
27 Jun 2021
KristianEkman
How to build an AI which plays Backgammon
Please Sign up or sign in to vote.
27 Oct 2015
Daniel Pfeffer
A faster method for performing interval arithmetic
Please Sign up or sign in to vote.
13 Mar 2019
Oana Mancu
Any deterministic game can be broken down to its core functionalities. By understanding them, one can implement fundamental algorithms such as Minimax (with alpha beta pruning), thus paving the way towards a better AI opponent.
Please Sign up or sign in to vote.
7 Jun 2016
GProssliner
cobj is a preprocessor based generator for interface based polymorphism
Please Sign up or sign in to vote.
4 Sep 2020
Mosi_62
Logistic regression, back propagation and support vector machine in comparison on the Iris data set
Please Sign up or sign in to vote.
10 Oct 2020
Sandeep Mewara
An optimization programming technique
Please Sign up or sign in to vote.
20 Jun 2021
Marcus Müller
Pandemic SEIR and SEIRV modelling software and infrastructure for the Corona SARS-COV-2 COVID-19 disease with data from Johns-Hopkins-University CSSE, Robert Koch-Institute and vaccination data from Our World In Data.
Please Sign up or sign in to vote.
29 Sep 2013
Amit Bezalel
Transfering subtitle synchronization from one subtitle file to another
Please Sign up or sign in to vote.
18 Aug 2014
José Cintra
Some suggestions of algorithms for solving the Pascal Triangle, addressing iterative, recursive and functional paradigms
Please Sign up or sign in to vote.
10 Nov 2014
Cryptonite
This is how to use the bisection method to calculate the nth root of a positive real number.
Please Sign up or sign in to vote.
29 Aug 2015
Eric Z (Jing)
1 alternative  
The traditional way to solve the ZigZag Conversion problem is to either build a 2d table or find a pattern among the index of the letters on the same row. There is also a beautiful solution which builds on top of Breadth First Search. Continue reading..
Please Sign up or sign in to vote.
26 Nov 2018
Jonas Selling
Clarifying the use of multi-pass filter cutoff correction
Please Sign up or sign in to vote.
25 Nov 2018
Bartlomiej Filipek
What performance can we get from C++17 parallel algorithms?
Please Sign up or sign in to vote.
30 Apr 2021
ADMGNS
An alternative method to Catmull-Rom, Chaikin or Bezier curve smoothing methods
Please Sign up or sign in to vote.
31 Jul 2012
Kenneth Haugland
How to calculate a reverbration time in a room
Please Sign up or sign in to vote.
13 Dec 2014
Andreas Gieriet
I prefer to encapsulate the status and access to it.The idea behind this: since the string is already grouped or sorted by characters, we can traverse the string from left to right and maintain a current state (which character with how many instances at that point). If the number of character...
Please Sign up or sign in to vote.
26 Mar 2015
BrainlessLabs.com
This tip describes a n ary tree structure.
Please Sign up or sign in to vote.
4 Mar 2016
JorgeLuisOrejel
This article is based on Chapter 2 of my unpublished textbook “Applied Algorithms and Data Structures.”
Please Sign up or sign in to vote.
27 Apr 2018
Arthur V. Ratz
In this article, we will formulate and discuss CLOPE data mining clustering algorithm that allows to drastically increase the quality and efficiency of categorized data clustering and can be easily used for recommendation-specific purposes
Please Sign up or sign in to vote.
13 Mar 2021
Peter Occil
Algorithms to turn biased "coin flips" into biased "coin flips", and how to code them.
Please Sign up or sign in to vote.
14 Jun 2012
Sergey Alexandrovich Kryukov
Please see my comment to the question. You need to specify your application type or UI library you want to use. If you don't have preference, you should tell us about it, as "what would you advise".Now, very clear tutorial is — on what topic? Don't expect and look for tutorials on...
Please Sign up or sign in to vote.
20 Jan 2013
Joezer BH
Hello Chona1171, A most common solution algorithm for your problem is to use the Dijkstra's Algorithm.Click to read about Dijkstra's AlgorithmThere's this nice article in CodeProject:C# - Visualizing Path Finding With Dijkstra, AStar, Bi-directional Dijkstra's, and Bi-directional...
Please Sign up or sign in to vote.
19 May 2014
databaseobjectmodel
Please Sign up or sign in to vote.
8 Feb 2015
Emiliano Musso
How to apply GA techniques fo solving problems in VB.NET. The example shows how to create solutions for a 2D maze, which will evolve to find the shortest path between two points.
Please Sign up or sign in to vote.
16 Dec 2015
Jesús Utrera
Using text retrieval TF-IDF technique to rank tokens in a text document
Please Sign up or sign in to vote.
26 Apr 2021
gggustafson
How well does the Interpolation of Colors match the Colors produced by Microsoft's Linear Gradient Brush?
Please Sign up or sign in to vote.
14 Jun 2021
gggustafson
This article revises an earlier revision of the Gradient Color Picker (V2). The incentive for the revision was a reader request for a larger number of initial color choices.
Please Sign up or sign in to vote.
19 Jul 2021N
The Sun God
Welcome to our Comparison on Sorting Algorithms Article. Here, we'll be comparing the various sorting Algorithms out there on the basic of several factors.
Please Sign up or sign in to vote.
10 Aug 2010
anshulskywalker
Understanding of Example Based Machine Translation (EBMT) system and how to create your own using exisiting tools
Please Sign up or sign in to vote.
31 Jan 2011
Nebula2028
Steps as above (Answer 1) - however, you could use a ListView instead of a listbox. Set the "view" property to "details" though! Add a ListViewItem for the e.g. ID and to that ListViewItem, add a subitem for the Address.Hope I'm not too wide of the mark here!
Please Sign up or sign in to vote.
14 Jun 2012
Espen Harlinn
Most likely you can use the Graph# library[^].Best regardsEspen Harlinn
Please Sign up or sign in to vote.
14 Jun 2012
VJ Reddy
Please see this CodeProject article Graphical BinaryTrees[^]In this article it is written that "This article is about binary trees. A Binary Tree contains unlimited number of nodes, the nodes can be removed, added, searched, etc. Here we will discuss on how to make a binary tree on c# code,...
Please Sign up or sign in to vote.
20 Jun 2012
Andreas Gieriet
This is an alternative for "Converting Postfix Expressions to Infix"
Please Sign up or sign in to vote.
5 Nov 2012
OriginalGriff
OK - look at it in parts: srand((unsigned) time(NULL));Initialises a random number generator. const int passLen = 10; for (int i = 0; i
Please Sign up or sign in to vote.
22 Jan 2014
Sergey Alexandrovich Kryukov
The best algorithm for storing passwords is not storing any passwords; this is unsafe and absolutely not needed for authentication.Surprised, disagree? Please see my past answers:i already encrypt my password but when i log in it gives me an error. how can decrypte it[^],Decryption of...
Please Sign up or sign in to vote.
12 Dec 2014
Thomas Daniels
Arrays are zero-based; by starting with i = 1 you skip one element. And by using c.Length - 1, you also skip the last element. You also don't need to store the whole list, you can store only the longest. It's also better to use StringBuilder than string concatenation. And the temp =...
Please Sign up or sign in to vote.
16 Feb 2015
Eric Z (Jing)
Evaluation order matters!
Please Sign up or sign in to vote.
20 Oct 2015
Sergey Alexandrovich Kryukov
I just realized that this is very similar to the well-known Knapsack problem, only you don't need to find the optimal solution, just need to list them all: https://en.wikipedia.org/wiki/Knapsack_problem[^].From this article, you can find the overview of known solutions. Not all of them will...
Please Sign up or sign in to vote.
24 May 2020
Jonas Vago
Application to show how to zigzag order a matrix
Please Sign up or sign in to vote.
29 Jul 2017
Debashis 10433656
How to create an ASP.NET control for image resizer and cropper keeping aspect ratio
Please Sign up or sign in to vote.
2 Dec 2017
Alvaro Carballo Garcia
Library extending the .NET numeric support
Please Sign up or sign in to vote.
20 Jul 2019
Arthur V. Ratz
The audience of this article's readers will find out how to perform association rules learning (ARL) by using FPGrowth algorithm, that serves as an alternative to the famous Apriori and ECLAT algorithms.
Please Sign up or sign in to vote.
19 Aug 2020
MehreenTahir
In this article we create a web app that trains the classifier on the go and recognizes grumpy facial expressions.
Please Sign up or sign in to vote.
11 Apr 2021
Peter Occil
Python code for partially-sampled random numbers for accurate arbitrary-precision sampling
Please Sign up or sign in to vote.
18 May 2010
xprog
Algorithm to convert Arabic Numbers to Arabic Text using C#
Please Sign up or sign in to vote.
7 Nov 2010
Pete O'Hanlon
You could always take a look at a project such as this[^] for sample code and projects to help you.
Please Sign up or sign in to vote.
19 Dec 2010
OriginalGriff
Yes, it will do.Because all you check for in the loop guard is "nums[i]
Please Sign up or sign in to vote.
1 Mar 2011
OriginalGriff
I would suggest that you start with Google: A little research goes a long way!http://www.google.co.uk/search?aq=f&sourceid=chrome&ie=UTF-8&q=Branch+and+Bound+algorithm+java[^]
Please Sign up or sign in to vote.
22 Sep 2011
Sergey Alexandrovich Kryukov
Private key is never sent; it would defeat the purpose of public-key security. You can exchange information with anyone even if someone spies on your connection all the time. You send public key to your partner. The public key is used to encrypt and cannot decrypt, you keep your private key...
Please Sign up or sign in to vote.
29 Nov 2011
Sergey Alexandrovich Kryukov
This is your graduation work. How can you demand a serious answer? Sorry, you cannot even correctly pose the problem and do not look competent in your own graduation work but want to get a credit (and a diploma!) for that. How are you going to make one of the experts interested in helping you?...
Please Sign up or sign in to vote.
6 Feb 2012
Espen Harlinn
Have a look at:WPF: A* search[^]It does most of what you actually need. Best regardsEspen Harlinn
Please Sign up or sign in to vote.
20 Feb 2012
ZC123456
As a developer who has spent a fair amount of time tweaking code for performance optimization, I'm having some issues with this article.First of all, who has generally accepted 10M iterations to test the performance? Unless your native code happens to be calling a function thousands or...
Please Sign up or sign in to vote.
6 Apr 2012
Wonde Tadesse
Here are some algorithm books.Data Structures and Algorithm Analysis(C++)[^]Data Structures and Algorithm Analysis(Java)[^]Data Structures and Algorithms[^]You can get a free book from here.http://freecomputerbooks.com/[^]
Please Sign up or sign in to vote.
4 Sep 2013
Grasshopper.iics
You would never want to use another photo editor in your AIO again
Please Sign up or sign in to vote.
12 Dec 2014
Maciej Los
I'd suggest to read this thread: Counting A Character[^].I do not see any performance issues by using Linq, unless the set of strings is very, very LARGE.It's really fast. Below query is executed in 0.001 sec.string input = "aaaabbcddddddddddeeffffg";var qry = (from c in input group...
Please Sign up or sign in to vote.
12 Dec 2014
BillWoodruff
Given the fact that the string is an ordered sequence, this gets very easy[1] to do with Linq:string test = @"aaaabbcddddddddddeeffffg";var longestGroup = test.GroupBy(ch => ch).OrderByDescending(grp => grp.Count()).First();char longestChar = longestGroup.Key;int...
Please Sign up or sign in to vote.
3 Feb 2015
Zoltán Zörgő
Here is the code of my approach:int max(int A, int B, int C){ return Math.Max(A, Math.Max(B,C));}void Main(){ var e = new byte[] {5,6,1,4,9,3,1,2}; var i=0; var j = e.Length-1; int A = e[i]; int C = e[j]; int B = 0; for(int x = i+1 ; x
Please Sign up or sign in to vote.
29 Sep 2015
nv3
After I read all the comments I feel tempted to give this basic problem a try. So, if I understand the problem correctly, the number of aliens living on day n is the number of aliens of the previous day (nobody dies) plus the number of eggs that hatch on this day. The latter is equal to the...
Please Sign up or sign in to vote.
11 Oct 2015
OriginalGriff
To answer your last two questions first:Yes.And Yes.The trouble is that this is a complicated area, and it's difficult to explain why algorithms are important in a small text box.There is a relationship between algorithms and programming, but it's not always obvious because an...
Please Sign up or sign in to vote.
29 Nov 2016
Miguel Diaz Kusztrich
Adding tools to help estimate the correct delay and embedding dimension
Please Sign up or sign in to vote.
6 Feb 2019
Mark H Bishop
Computational classes and a GUI interface to illustrate usage
Please Sign up or sign in to vote.
28 May 2020
phil.o
In an adjacency matrix of a graph, a value of zero means that there is no edge between corresponding vertices. For example, in the matrix you have shown, note that the values in the diagonal are all zeroes, because there is no loop edge on any...
Please Sign up or sign in to vote.
1 Sep 2020
Stefan_Lang
This is not a programming question. It's about finding an algorithm that gives you a correct result. Additionally it may be about finding an algorithm that gives you the result quickly, but you didn't say that. Either way, you might get more...
Please Sign up or sign in to vote.
22 Nov 2020
Sandeep Mewara
A look into graph based algorithm
Please Sign up or sign in to vote.
25 Apr 2010
ziopino70
7 alternatives  
Hi, I have to detect repetitions in signal data (carrier-modulated digital signal) which looks similar that 10101010 0001010000001010 0001010000001010 0001010000001010 0101010000000000(spaces just for human-readability :-D )As you can see, the 0001010000001010 pattern repeats. Can you...
Please Sign up or sign in to vote.
28 Apr 2010
CPallini
Josh Gray wrote:* Is there likely to be a tangible benefit to doing this or would a compiler (gcc in my case) make this optimisation?VC++ compiler takes care of such optimization (I see no div operation).I guess gcc do the same, you may verify it using the -S switch and looking at the...
Please Sign up or sign in to vote.
19 Dec 2010
Manfred Rudolf Bihy
Hi Arash,the line that reads int temp = i;should most probably read like int temp = num[i];because i and j are indexes and what you're trying to accomplish withthe variable named temp is swapping of the array element num[i] with num[j].That's the problem I see with your...
Please Sign up or sign in to vote.
23 Jan 2011
Stephen Hewitt
Why not just use lhs==rhs? Vectors have an operator==. 
Please Sign up or sign in to vote.
19 Feb 2011
Albin Abel
Hi,A detailed explanation of Bayes theorem is hereBayesian Example implementations are hereA Naive Bayesian Spam Filter for C#[^]A Naive Bayesian Classifier in C#[^]
Please Sign up or sign in to vote.
4 Mar 2011
Dylan Morley
I'd say have a look at Autotune.Nethttp://channel9.msdn.com/coding4fun/articles/AutotuneNET[^]As you'll see, pitch detection is obviously vital to an autotune program, so that will help you with what you're trying to do.
Please Sign up or sign in to vote.
18 Mar 2011
Manfred Rudolf Bihy
This little elaboration will help you along the way: http://www.euclideanspace.com/maths/geometry/affine/aroundPoint/index.htm[^].It shows how to combine the rotation matrices with a translation to achieve the rotation about a given point. The page you found gives you the rotation matrices for...
Please Sign up or sign in to vote.
23 Mar 2011
OriginalGriff
No.You first have to define "best": Best for a sort algorithm might be "fastest": but even then "fastest" will depend on data - if you know the data has a particular pattern, then the "fastest" general algorithm may not be the quickest to sort the specific data.
Please Sign up or sign in to vote.
24 Mar 2011
Espen Harlinn
If there are open-source implmentations available, and there usually are - test that each of them is capable of correct behaviour - sometimes some algorithms are not able to evaluate all possible inputs - so it's a good idea to check that they have the desired behaviour.You may be interested...
Please Sign up or sign in to vote.
29 Apr 2011
Ciumac Sergiu
Hi,I've used some time ago a logarithmically spaced vector on 32 bands with Math.E logarithm base.There was a need in specifying min/max values within the vector, the logarithm base (Math.E is a standard choice, and the number of points)private static void GenerateLogSpace(int min, int...
Please Sign up or sign in to vote.
7 Jun 2011
Ciumac Sergiu
Hi,stack overflow happens when your computer's stack gets too many function calls, thus strings over 150 chars generate such error. There are several workarounds that you can use in order to solve this problem:1) optimize your code to get fewer function calls2) use Stack object in order to...
Please Sign up or sign in to vote.
19 Jul 2011
Anil Dhandar
Convert an input value to an output value in a proportional range - requires tricky calculations.
Please Sign up or sign in to vote.
22 Dec 2011
AmirAmirA
1 alternative  
I have been doing many different stuff in image processing with C# and I know how to do edge detection , Gaussian Blur and many other things but now im stuck with this one...I have tried different ways to do it and ive gotten close but its not surface blur.Surface Blur: Blurs an image...
Please Sign up or sign in to vote.
4 Jan 2012
OriginalGriff
We do not do your homework: it is set for a reason. It is there so that you think about what you have been told, and try to understand it. It is also there so that your tutor can identify areas where you are weak, and focus more attention on remedial action.Try it yourself, you may find it...
Please Sign up or sign in to vote.
3 Mar 2012
Shahin Khorshidnia
May be these links help you.Soundex:http://rosettacode.org/wiki/Soundex[^]DoubleMetaPhone:http://drdobbs.com/184401251?pgno=2[^]And google is a good stuff !
Please Sign up or sign in to vote.
3 Apr 2012
Clifford Nelson
Seems like this one is the standard right now for algorithms: http://www.amazon.com/Introduction-Algorithms-Thomas-H-Cormen/dp/0262033844/ref=sr_1_1?s=books&ie=UTF8&qid=1333499461&sr=1-1[^]. There really is not much in C# on algorithms, probably because most colleges use Java and not C#, and...
Please Sign up or sign in to vote.
1 May 2012
Sergey Alexandrovich Kryukov
In the case of N=1 she is used in our life as a constitutional monarch. Please check with http://en.wikipedia.org/wiki/Constitutional_monarchy[^].Yes, in our world.For other uses, please see:http://en.wikipedia.org/wiki/The_Queen_%28disambiguation%29[^].—SA
Please Sign up or sign in to vote.
11 Sep 2013
Sergey Alexandrovich Kryukov
Now, one more, pretty obvious algorithm.Create N points in same range, for example, the square on the points (0,0) and (1, 1), where N is a random number >= 3. For the obtained set of points, build a convex hull. You can find some algorithm if you read this:...
Please Sign up or sign in to vote.
25 Nov 2013
Sergey Alexandrovich Kryukov
Please see my comments to the question, and the main one would be the first, about personal preference, which render the whole idea making little sense. However, it's not clear, maybe you already solved it. It can be solved by asking about personal preferences in some way. Every time I had to...
Please Sign up or sign in to vote.
31 Jan 2015
Andreas Gieriet
For small numbers, you might calculate all permutations and weight each permutation with the largest share. The minimum of the largest share (not necessarily only one) is the best choice according to your criterions.E.g.ABCweight561 4 9 3 1 22056 14 9 3 1 21956 1 49 3 1 21556 1 4...
Please Sign up or sign in to vote.
23 Jun 2015
DrABELL
Computational algorithms pertinent to finding the great-circle distance between 2 points on Earth
Please Sign up or sign in to vote.
26 Apr 2016
raddevus
Adding more methods (select points, draw triangles, etc) which allow us to do some specialized drawing on the HTML5 Canvas so we can investigate the Calc Convex Hull algorithm.
Please Sign up or sign in to vote.
28 May 2016
Patrice T
This is HomeWork, but you have done some work.Advice:- In first I would have separated the code solving each exercises. It is just making reading the code easier and debugging too.exercise 3You already know the maximum length of sequence.you have basically 2 solutions.- you build...
Please Sign up or sign in to vote.
26 Oct 2018
José Cintra
Generic algorithm to generate mathematical sequences
Please Sign up or sign in to vote.
14 Dec 2018
Philipp_Engelmann
Simple Linear Regression from scratch in Rust
Please Sign up or sign in to vote.
28 Oct 2020
Sandeep Mewara
Linear-time partition: A divide & conquer based selection algorithm
Please Sign up or sign in to vote.
22 Jan 2021
OriginalGriff
The Taylor series for sin(x) is simple: sin(x) = pow(x, 1) - pow(x, 3) / 3! + pow(x, 5) / 5! - ... But your implementation does two things: starts with -1 instead of 1, and makes it look a lot more complex than it needs to be. If you don't...
Please Sign up or sign in to vote.
31 Mar 2021
Fedor Naumenko
Find type of distribution and parameters from set of distributed physical values
Please Sign up or sign in to vote.
13 Apr 2010
Dylan Morley
Step 2 in the following article has the source you're after I thinkhttp://mitpress.mit.edu/e-journals/Videre/001/articles/Little-Boyd/gait/system.html[^]
Please Sign up or sign in to vote.
13 Apr 2010
Saurabh.Garg
Well the algorithm is clearly described in this paper[^]. I haven't seen a code for parallel optical flow anywhere so I guess you might have to code it yourself.-Saurabh
Please Sign up or sign in to vote.
15 Apr 2010
OriginalGriff
I'm not sure there is a formal algorithm for this (I could be wrong), but the simplest way is just to scan through: if the current element is not the same as either of the elements to either side, it is unique. Pretty simple, isn't it? Or am I missing something?Oh, and the word you want is...
Please Sign up or sign in to vote.
28 Apr 2010
User 583852
2 alternatives  
When performing division by a constant that is a multiple of 2 we can optimise the operation by performing a right shift.eg i = i >> 3;is equivalent to i = i / 8;My questions are:* Is there likely to be a tangible benefit to doing this or would a compiler (gcc in my case)...
Please Sign up or sign in to vote.
4 Jun 2010
Richard MacCutchan
You could have tried this[^] first.
Please Sign up or sign in to vote.
4 Jun 2010
Sandeep Mewara
I googled this [^]and got below any many more links!http://www.inkscape.org/[^]http://www.rotordesign.com/servolite/body_dxf_to_gcode.html[^]BTW, how is your question related to C#?
Please Sign up or sign in to vote.
16 Jun 2010
Aescleal
total_day_wind looks like either a float or double to me. It's a bit trivial to sort a single value...If you've got a collection of wind speeds somewhere and you want to sort them into ascending order then use std::sort:std::vector wind_speeds;// Much clever code to...
Please Sign up or sign in to vote.
7 Nov 2010
Kanasz Robert
1 alternative  
Hi,can somebody advice me a good book or website for neural networks? RegardsRobert
Please Sign up or sign in to vote.
3 Dec 2010
Manfred Rudolf Bihy
Hi Pallab,using file based merge sort would be the way to go for you.Please read this blog entry:http://splinter.com.au/blog/?p=142This merge sort works by breaking one big file into smaller chunks.These are conventionally sorted and written to disk. Then in a finaloperation...
Please Sign up or sign in to vote.
7 Dec 2010
Cedric Moonen
In the book Modern C++ design[^] by Andrei Alenxandrescu, there's a chapter about small object allocation. He describes an efficient way of managing a lot of small objects in memory (allocating and deallocating them yourself in an efficient way). I don't know if this worth to buy the book just...
Please Sign up or sign in to vote.
19 Dec 2010
JF2015
Is that what you want?double result = bigzarb(x, w) *Math.Pow(10,m)+ (bigzarb(x,w)+bigzarb(w,y))*Math.Pow(10,m) +bigzarb(y,z);textBox1.Text = result.ToString()return result;
Please Sign up or sign in to vote.
13 Jan 2011
stevedayus
http://www.cnc...
Please Sign up or sign in to vote.
28 Jan 2011
Espen Harlinn
I guess you are attempting to create some sort of resizable memory stream since your last line reads: Read, Write, Seek, ... members to manipulate the contentTry using the existing MemoryStream[^]. If that's not good enough - try reimplementing the MemoryStream using a list of buffers....
Please Sign up or sign in to vote.
4 Feb 2011
Andrew Brock
If this isn't an assignment, and the algorithm isnt set in concrete, i would suggest taking a look at huffman coding[^].If it is a set algorithm for you to implement then we generally don't do your homework but here goes#include #include //comp()void...
Please Sign up or sign in to vote.
15 Feb 2011
DrABELL
The computational efficiency of the Euclid's algorithm is much higher that the alternatives
Please Sign up or sign in to vote.
21 Feb 2011
AkilMai
2 alternatives  
Hello guys,I decided to try and do a problem about analyzing the worst possible runtime of an algorithm.Since I'm a beginner and I want to do an understand this right I require some help.I came accros this problem in a book that uses the following algorithm:Input: A set of n points...
Please Sign up or sign in to vote.
22 Feb 2011
Fredrik Bornander
You're doing C * n(n - 1) iterations (where C is some constant), yielding T(n)=C*n^2 - C*n.Remember that for the O notation we drop constant factors and lower order terms giving O(n)=n^2.Because you're dropping constant factors I don't think it makes any sense to represent the 1, 2, 3...
Please Sign up or sign in to vote.
4 Mar 2011
Albin Abel
Each piano key has unique frequency. So the frequency domain i.e fourier transformation helps to identify the pattern of the pure sound from noise. That pattern you could use compare the sound."Another thought I had was that a note should be more or less the same each time it is played. If...
Please Sign up or sign in to vote.
4 Mar 2011
dasblinkenlight
This problem is NP-hard. Hundred vertices is enough to make any implementation run almost forever (until it runs out of memory) because it needs to compute way too many things.| /*\ /*\ /*\ /*\ /*\ /*\ /*\ /*\ /*\ /*\ /*\ /*\ /*\|S---*---*---*---*---*---*---*---*---*---*---*---*---T| \*/...
Please Sign up or sign in to vote.
24 Mar 2011
CPallini
Yes, run a test: feed the two algorithms with the same input data (making sure the output is correct) and measure performance.
Please Sign up or sign in to vote.
25 May 2011
The_Real_Chubaka
1 alternative  
Hello,I am supposed to take data from wikipeadia dump or freebase dump or dbpedia.I am then supposed write code that gives as output what every datum in that database is. eg: name of a person or a bussines, address,... It does not matter in what language i write the code but, I’m only...
Please Sign up or sign in to vote.
20 Jul 2011
Firo Atrum Ventus
2 alternatives  
Hi all,I'm currently debugging a ship monitoring system. In that application I found whole heaps of bugs, fortunately I can solve every single one of them, except this one. So please help me.Here's the explanation:The bug is located within a distribution server, and I suspect (No, I'm...
Please Sign up or sign in to vote.
3 Aug 2011
Pete O'Hanlon
According to the paper where you ripped that phrase from, it's an area of research aimed at various targets:1. Identifying commercials.2. Video copyright.3. Video clustering.If you want to find out more about it, I would suggest that you read the PDF available here[^].
Please Sign up or sign in to vote.
19 Jan 2012
OriginalGriff
A very simple google lead straight to Wiki: http://en.wikipedia.org/wiki/Analysis_of_algorithms[^] which contains all of the info you need.In future, please try to do at least basic research yourself, and not waste our time and yours.
Please Sign up or sign in to vote.
4 Mar 2012
Raimis9
Here[^] you will find library for matrix calculations.Good luck.
Please Sign up or sign in to vote.
26 Mar 2012
Søren Gullach
A Shunting yard algorithm in C#
Please Sign up or sign in to vote.
23 Apr 2012
YvesDaoust
For an efficient solution, you can work as follows:- declare an array of strings that is indexed by all possible character values (128 entries will do for ASCII characters); let it be Confusions;- every entry in the array gives the list of possible confusions; the string representation...
Please Sign up or sign in to vote.
24 May 2012
Espen Harlinn
I guess you are looking for bool next_permutation[^]Call it i times and you'll have the i-th permutation. (or the i-1 combination)Best regardsEspen Harlinn
Please Sign up or sign in to vote.
11 Nov 2012
OriginalGriff
Assuming that your note array in ordered largest first, I would simply divide the value by each note value in turn: the quotent is the number of those notes to issue, the remainder gets passed down to the next note denomination.So if your value is 123 and your notes are 10, 5, and 1:123 /...
Please Sign up or sign in to vote.
15 Nov 2012
killing the bug softly...
Please have a look into the following links 1. Calculate Golden ratio[^] 2.Golden ratio calculator[^]
Please Sign up or sign in to vote.
29 Nov 2012
Krunal Rohit
The most common attributes of logarithmic running-time function are that:the choice of the next element on which to perform some action is one of several possibilities, and only one will need to be chosen or the elements on which the action is performed are digits of nThis is why, for...
Please Sign up or sign in to vote.
29 Nov 2012
YvesDaoust
The Big-Oh notation has a well-defined mathematical meaning. When you say that a function f of a variable N is big-Oh of some function g of N, it means that f(N) is bounded above by C.g(N) for all N [except maybe for the first values], where the coefficient C is called the "hidden constant"....
Please Sign up or sign in to vote.
24 Feb 2013
Thomas Daniels
Please try first what you want to do, and if you have a specific problem, ask a question. You don't provide what you've tried, you don't provide some source code, you don't provide the programming language you're using ...Also, don't fill your question with meaningless commas.If you...
Please Sign up or sign in to vote.
26 Jun 2013
OriginalGriff
Google is your friend: Be nice and visit him often. He can answer questions a lot more quickly than posting them here...A very quick search gave 4 1/2 million results:...
Please Sign up or sign in to vote.
28 Jul 2013
nv3
I know there is a method for calculating the square root manually, but that one ins not particularly useful for calculating it on a computer. Computers can multiply and divide numbers with many digits and the execution time is nearly the same, no matter the factor are a single digit or contain...
Please Sign up or sign in to vote.
17 Sep 2013
OriginalGriff
We do not do your homework: it is set for a reason. It is there so that you think about what you have been told, and try to understand it. It is also there so that your tutor can identify areas where you are weak, and focus more attention on remedial action.If it's an interview question,...
Please Sign up or sign in to vote.
26 Sep 2013
Rob Philpott
That's a very odd way to do it. I wouldn't concern yourself with list size at all.I'd recommend a two stage approach, first identifying the node you want to remove, the removing it. A good way to keep things consistent is to have an empty dummy node at the beginning of the list, purely to...
Please Sign up or sign in to vote.
25 Nov 2013
Ron Beyer
To add to what Sergey said (in that finding the seats is O(N), but really doesn't say what ones are the "best".You could assign weights to each seat, with "better" seats having higher values. While searching for seats you hold the currently selected seats as the highest value (sum of y...
Please Sign up or sign in to vote.
2 Dec 2013
ExcelledProducts CEO
Closest latitude and longitude to a referenced latitude and longitude.
Please Sign up or sign in to vote.
26 Jan 2014
thatraja
Similar questions with answersC# Facial Expression Recognition[^]Facial Expression Recognition[^]facial expression recognition[^]Search Codeproject & Google for more
Please Sign up or sign in to vote.
25 Mar 2014
CHill60
As Richard MacCutchan said, you will need to design a Database first to capture the information about each meal each user has had.Here's a link to a beginners guide to databases[^]Think carefully about the tables you will need and what sort of information you will need to...
Please Sign up or sign in to vote.
24 May 2014
Richard MacCutchan
You can use one of the classes in the System.IO.Compression Namespace[^].
Please Sign up or sign in to vote.
12 Dec 2014
Matt T Heffron
Here's a solution that just counts the characters and keeps track of the longest sequence seen so far. class Program { static string input = "aaaabbcddddddddddeeffffg"; // expected: "d" static void Main(string[] args) { var longest = FindLongestRepeat(input); ...
Please Sign up or sign in to vote.
19 Dec 2014
Garth J Lancaster
read all the articles and books you canpick a 'pet' project or two and practice applying and redefining the implementation of algorithmsthere is NO magic potion you can take - it all takes time, knowledge & practice
Please Sign up or sign in to vote.
19 Dec 2014
Andreas Gieriet
First of all, it's helpful to agree on the term Algorithm[^]: [...] In mathematics and computer science, an algorithm [...] is a step-by-step procedure for calculations. [...]There are various angles to look at your question.If it's about your skills to implement an existing step-by-step...
Please Sign up or sign in to vote.
11 Jan 2015
Kornfeld Eliyahu Peter
I can't see the difference... O(n) means that (in worst case) you have to visit every node to get the answer.It does not changes if you check it from the beginning to the end or from both end to the middle...As to check one item is a constant time and you ave to check all items (in worst...
Please Sign up or sign in to vote.
30 Jan 2015
bling
You can't implement merge sort "in place". If you swap or overwrite some of the elements, it isn't a merge sort anymore. In this case, moving an element from one sequence to other potentially breaks the other sequence (eg. it is no longer ordered).static std::vector merge(const...
Please Sign up or sign in to vote.
9 Mar 2015
CHill60
This the wrong forum for conducting research.I suggest that you will get a better response from google[^]
Please Sign up or sign in to vote.
11 Apr 2015
OriginalGriff
Do your own.Looking at code doesn't tell you why decisions were made, what alternatives were considered, or why they were rejected."Doing" is a better way of learning - it encourages the growth of skills instead of just blindly repeating existing code and hoping it's the best way to do it.
Please Sign up or sign in to vote.
12 Apr 2015
Peter Leow
Understanding the mechanism of GA is already hard, not to mention trying to interpret other people's code that implements it. That is even harder if you never code before. Come back to the GA, you can create a model like this:1. Represent each potential solution by a 40 gene-chromosome,...
Please Sign up or sign in to vote.
23 Aug 2015
CPallini
It doesn't look that difficult: The requirements already define the algorithm (that uses independent allocation strategies).At each input, based on the number of passengers, you just have to find the first fit, considering only available seats. What is your doubt about?
Please Sign up or sign in to vote.
14 Sep 2015
OriginalGriff
We can't answer that: it's down to you.If you have "very little interest in algos" then only you can do anything to encourage you to start learning. You can't force someone to learn something unless they are prepared to invest time, effort, and interest in the subject matter; no book,...
Please Sign up or sign in to vote.
29 Sep 2015
PIEBALDconsult
Here's an SQL Server Recursive Common Table Expression to do it:WITH cte AS( SELECT -1 [Day] , 1 [Aliens] , 0 [+1] , 0 [+2] , 0 [+3] , 0 [+4] , 0 [+5] , 0 [Eggs]UNION ALL SELECT [Day] + 1 , [Aliens] + [+1] , [+2] , [+3] , [+4] , [+5] , ( [Aliens] + [+1] ) * 3 , [+2] + [+3] + [+4]...
Please Sign up or sign in to vote.
12 Oct 2015
CHill60
You have already been given some advice on how to start to learn to program.You don't "learn algorithm" - you use algorithms to solve problems - there are many, many algorithms to address many, many different problems. An explanation was provided against your earlier post what is the...
Please Sign up or sign in to vote.
12 Oct 2015
Sergey Alexandrovich Kryukov
It sounds like a usual chicken or the egg problem.You always learn everything in parallel and iterations. Say, you take a book on language and read it from the beginning to the end. If you are a beginner, you won't really understand and appreciate everything, even if you do those programming...
Please Sign up or sign in to vote.
17 Oct 2015
José Cintra
Tips for creating mathematical cross-platform applications in JavaScript and display formulas and other content with MathJax and JQuery Mobile.
Please Sign up or sign in to vote.
22 Dec 2015
OriginalGriff
"How do I prepare for such interview questions? Are there any websites or resources that will help me"I'm sorry to tell you this, but if you have to ask, then the answer is "no".If you want to pass an interview that involves questions like this, then the only way is to know your stuff -...
Please Sign up or sign in to vote.
14 Jan 2016
Sergey Alexandrovich Kryukov
The answer is: yes, because the "naive method" will give your O(N) time complexity anyway. In fact, all non-nonsense algorithm will give you O(N). It's easy to understand why: 1) given known index in the array, the time complexity of taking the element is always O(1) (that is, a constant), due...
Please Sign up or sign in to vote.
20 May 2016
George Jonsson
Regular expressions are not the best tool for this, because you will have nested parts of your input text.In this case it with be more robust to use a parser, but that has a bit of a learning threshold. ANTLR4 is a free parser originally for Java, but it has a version for C# as well. See...
Please Sign up or sign in to vote.
6 Jun 2016
CPallini
You should do your homework yourself. Please ask here only specific questions.
Please Sign up or sign in to vote.
7 Jun 2016
Patrice T
Quote:Users should be able to add new friends (as many as they want!) and store the number of days ago that they last talked to each friend. Let users update this value (but don't let them put in bogus numbers like negative values). If the data is to be stored in a database, it is a bad idea to...
Please Sign up or sign in to vote.
3 Aug 2016
Vyacheslav Chernykh
F#-implementation of algorithm for incremental construction of minimal deterministic finite automata through adding and removing strings.
Please Sign up or sign in to vote.
11 Jul 2016
PIEBALDconsult
Because the developer doesn't know that he should start at 3, step by 2, and stop at sqrt(num) ; typical rookie mistake.
Please Sign up or sign in to vote.
30 Oct 2016
Sander Rossel
Found it!After hours of trying I decided to leave the problem alone for a while and now, after a few weeks, I fixed it in like 5 minutes.The while loops should look like this:while (items[map[low]].value
Please Sign up or sign in to vote.
26 Jul 2018
Jochen Arndt
Let the loop run downwards. Then the exponent value can be assigned to the loop variable initially. Because you have to initialise the result too and will use exponent, this must be done after initialising the loop variable. Fortunately, C/C++ for loops allow multiple statements in the init...
Please Sign up or sign in to vote.
15 Sep 2018
OriginalGriff
We do not do your homework: it is set for a reason. It is there so that you think about what you have been told, and try to understand it. It is also there so that your tutor can identify areas where you are weak, and focus more attention on remedial action. Try it yourself, you may find it is...
Please Sign up or sign in to vote.
1 Oct 2018
Rick York
I tried your formula in my little test bed which uses VS17 and I got exactly the same results you did. I tried various values for the iteration count from 32 to 128 and all gave the same result. FWIW, above about 127 gives an NAN. I think you are running into the numerical limits of 64-bit...
Please Sign up or sign in to vote.
3 Oct 2018
Daniel Pfeffer
Writing a good mathematical library is very difficult. The library must not only give accurate results, but must also preserve other attributes, such as monotonicity (i.e. if the mathematical function is monotonic, your approximation should also be monotonic), odd/even behaviour (i.e. f(x) ==...
Please Sign up or sign in to vote.
26 Nov 2019
CPallini
Provided the loops are not nested, your final result is correct, in my opinion. Since for i = 1 to k do // k * const c[i] = 0 for j = 1 to n do // n * const c[A[j]] = c[A[j]] + 1 for i = 2 to k do // (k-1) * const c[i] = c[i] + c[i-1] for j = n-1 down to 1 // (n-1) * const B[...
Please Sign up or sign in to vote.
24 Sep 2020
CPallini
The argument of isdigit is supposed to be a character, but you are passing it a int variable. Assuming your code should really deal with numbers (that is integers) and not digits, you might re-write your program this way (note you don't need an...
Please Sign up or sign in to vote.
14 Feb 2021
Patrice T
Quote: im too stupid and i didnt try anything can anyone help me to solve this quetion No, because you don't want help, you want us to do the job and give you a working solution so you can claim it is yours. It is rude of you. For this kind of...
Please Sign up or sign in to vote.
18 Sep 2020
OriginalGriff
If you don't understand the question - and it's pretty clear - you need to talk to your tutor and get them to explain it to you in terms you can understand. Until you understand the question, you have no hope whatsoever of understanding - or...
Please Sign up or sign in to vote.
21 May 2021
Rick York
I used some code from : GitHub - drasis/cpp_maze_generation: generating mazes in different shapes[^] to make mine. Sorry, I can't show you a shot right now. I found a link there to a great reference page on mazes : Think Labyrinth: Maze...
Please Sign up or sign in to vote.
28 Jun 2021
ADMGNS
A new method for 2D polyline simplification and also smoothing that alternative to Douglas-Peucker and curvature-based simplification algorithms
Please Sign up or sign in to vote.
16 Apr 2010
DaveAuld
Use the inbuilt methods of the List(of ) class to find the min or max values, e.g. Dim ints() As Integer = {11, 3, 5, 2, 8, 9} Dim intList As New List(Of Integer)(ints) MsgBox(intList.Min)
Please Sign up or sign in to vote.
21 Apr 2010
CPallini
Ok, and what is your problem about? :)JanTCode wrote:I want to know the executing times of the sentence labled by '@' when n is givedI think you've at least two options:Count.Develop a program for counting on your behalf.
Please Sign up or sign in to vote.
23 Apr 2010
CyberSamuraiii
3 alternatives  
Hi all,I've landed in a situation where i need the top N number of items in an array, work on those items and reinsert (or update) them back at the exact same indices. I realized that the easiest way would be to sort an array 1st then pick N number of the highest elements, but I find my...
Please Sign up or sign in to vote.
22 Apr 2010
#realJSOP
With the pitiful amount of info you've provided, the best I can suggest is that you look into using a Dictionary object instead of an Array.
Please Sign up or sign in to vote.
28 Apr 2010
Arindam Tewary
When you write bitwise shift operation equivalent microoperation takes only one micro-operation to be performed by the ALU(CPU). It takes binary representation of the value supplied and performs a single "shift" micro operation.But when you write a division(float) it is converted into either...
Please Sign up or sign in to vote.
1 May 2010
CPallini
If you understand properly the theory then it shouldn't be too difficult. Make sure you understand how recursion works and then start with a very simple grammar. :)
Please Sign up or sign in to vote.
26 May 2010
Charles Keepax
It is easier to help if you give a description of in what way your code doesn't work, rather than just stating that it doesn't work.However, I am guessing that your program appears to run for ever? I would suggest that you investigate what happens when a[right],a[left] and piwot are all the...
Please Sign up or sign in to vote.
2 Jun 2010
Poonamol
2 alternatives  
Hi,I need to parse a CSV file[^].My file data is in below format,NRTIT15;15/05/2005;NRTIT16;16/06/2005;OZ9520;03/09/2004;I need to check the blank lines in the file at EOF.If my file contains line feed at the end, i want to print the error mesasge.For each line i am using \n....
Please Sign up or sign in to vote.
7 Jun 2010
Aescleal
Ron Rivest was co-author of a book on Algorithms in the early 90s that described MD4. It should be available from any good technical library.It's called: "Introduction to Algorithms, Third Edition" by Cormen, Leiserson, Rivest and Stein.Failing that look in RFC 1320, it's got all the...
Please Sign up or sign in to vote.
11 Jun 2010
Henry Minute
Depending on what your Polygon is (Image, Array of Point etc....) you might be able to use a Matrix Translation. If so Matrix Transformation of Images in C#, using .NET GDI+[^] might be of some use.
Please Sign up or sign in to vote.
31 Aug 2010
helianthus87
Do you asking about some math to calculate angle between 2 vectors to check the arc? You mentioned about 3 points and i asume there is something like this:[how do i see this]then you need to calculate angle or check dot product between 2 vectors and according to result you will be able...
Please Sign up or sign in to vote.
18 Dec 2010
Henry Minute
You have your logic wrong in the final two while loops.try:while (x
Please Sign up or sign in to vote.
5 Jan 2011
wizardzz
Just follow the wiki entry to the algorithm for solving it:[^]
Please Sign up or sign in to vote.
1 Feb 2011
Pritesh Aryan
3 alternatives  
Suppose random points P1 to P20 scattered in a plane. Then is there any way to sort those points in clock-wise.See image Here.Here we can’t use degree because you can see from the image many points can have same degree. E.g, here P4,P5 and P13 acquire the same degree.
Please Sign up or sign in to vote.
1 Feb 2011
OriginalGriff
The best suggestion I can give is to have a look at Wolfram Alpha Mathworld: http://mathworld.wolfram.com/LHospitalsRule.html[^] - start here and see what you can find.If nothing else, it may explain it better than we could because it has all those funny little symbols we only used for APL...
Please Sign up or sign in to vote.
16 Feb 2011
Albin Abel
HiInterpol...
Please Sign up or sign in to vote.
16 Feb 2011
Ramalinga Koushik
Hope Interpolation Methods[^] will give you an idea.
Please Sign up or sign in to vote.
22 Feb 2011
CDP1802
To begin with, you should take a look how many steps the algorithm has to take to end.For n = 2 this would be 1, as it terminates on line 1.For n > 2 the number of steps is determined by the two nested loops and be equal to the number of times the outer loop is executed times the number...
Please Sign up or sign in to vote.
27 Feb 2011
Manfred Rudolf Bihy
There is an article here on CP: A C++ Implementation of the Blowfish Encryption/Decryption method[^].Hope that helps you!
Please Sign up or sign in to vote.
16 Apr 2011
LaxmikantYadav
Hi Reena,Please find out the source code of Blowfish algorithm on below link.Down load from http://www.schneier.com
Please Sign up or sign in to vote.
11 Mar 2011
#realJSOP
If your desired result is a final list of unique items, you could try adding the items from each Dictionary to a HashSet, and go from there. I don't know if this is going to be any faster, but it's worth a shot.You might be able to do this in .Net 2.0 - extension methods (typed off the top...
Please Sign up or sign in to vote.
18 Mar 2011
Sergey Alexandrovich Kryukov
I think this totally explains how to solve this simple problem: http://www.euclideanspace.com/maths/algebra/matrix/orthogonal/rotation/index.htm[^].—SA
Please Sign up or sign in to vote.
29 Apr 2011
CPallini
My attempt (not tested):import java.util.ArrayList; //Create logarithmically spaced vectorpublic static ArrayList logarithmicSpace(int start, int end, int count){ ArrayList ArrList= new ArrayList(); for(int i = 0; i
Please Sign up or sign in to vote.
1 May 2011
Sergey Alexandrovich Kryukov
Without extra library?! Well, AForce.NET is using .NET only, so, here is the plan:Try to solve the problem all by yourself;When you get enough experience and still face problems, build AForge.NET library and try to understand how it works; may be it will help you;Go back to item 1;...
Please Sign up or sign in to vote.
14 Jul 2011
CPallini
shiny1366 wrote:which algorithm will be best for finding shortest path between 2 cities?Dijkstra or Floyd-WarshallTGoogle[^].
Please Sign up or sign in to vote.
19 Jul 2011
YvesDaoust
If I am not too wrong, I think that the rows in your sample file can be described by the following grammar:(word) /m/ word (word) number . number (word) [/m/ word]Where word stands for a non-empty sequence of lettersnumber a non-empty sequence of digits(item) a sequence of item...
Please Sign up or sign in to vote.
27 Jul 2011
YvesDaoust
Because of the specific terminology in use, I cannot understand the details. More specifically, I have no idea what a Downline is nor what AllLegs can mean.Anyway, it seems to me that this problem can be formulated as a set of linear inequations of the form 0
Please Sign up or sign in to vote.
31 Jul 2011
Sergey Chepurin
I hope you are able to slightly modify the code of permutation algorithm provided here to get the results needed.
Please Sign up or sign in to vote.
13 Aug 2011
Christian Graus
Wow. This forum is for programmers. People who write software for computers. It sounds like you barely know how to use one. What does it mean ? It's the name of a program, I assume. I suggest you find a forum that operates at your level ( if such a forum exists ) and ask your questions...
Please Sign up or sign in to vote.
31 Aug 2011
dasblinkenlight
Convert the tree to a list using an in-order traversal[^]. The list will be sorted, except for the two swapped elements. The first of them will be followed by a smaller number; the second one will be preceded by a larger number.9 10 16
Please Sign up or sign in to vote.
14 Sep 2011
User 7429338
Your dist() function is expecting an array of 3 doubles. Assuming your input variables are declared like so: double brick_v[3]; double metal_v[3];You should call dist() like so: dist(brick_v,metal_v);Note that the return value of dist() is a double (one number) and not...
Please Sign up or sign in to vote.
14 Sep 2011
Simon Bang Terkildsen
dist takes two double arrays of length 3, you're passing two doubles, assuming brick_v is an array of double then brick_v[3] is a double
Please Sign up or sign in to vote.
29 Nov 2011
Richard MacCutchan
I gave you some links two weeks ago, and here[^] is another you could have found easily, what have you been doing since then to research this question?
Please Sign up or sign in to vote.
29 Nov 2011
CPallini
MP3Stego[^] provides some interesting links.
Please Sign up or sign in to vote.
19 Jan 2012
Manfred Rudolf Bihy
You really want to read this Wikipedia article: Computational complexity theory[^].The meaning of input size depends on the concrete algorithm that is being analysed.For the definition of "bestcase,worsecase,averagecase" please see the referenced article.Short example:Appending a...
Please Sign up or sign in to vote.
6 Feb 2012
thatraja
Check this onehttp://www.databaseanswers.org/data_models/[^]
Please Sign up or sign in to vote.
21 Mar 2012
Sergey Alexandrovich Kryukov
I don't think the whole notion of such algorithm is applicable to the flash devices at all."Removable flash memory cards and USB flash drives have built-in controllers to perform wear leveling and error correction so use of a specific flash file system does not add any benefit.", according...
Please Sign up or sign in to vote.
26 Mar 2012
Pranit Kothari
3 alternatives  
Hi,As Big O notation, its shows worst case possibility.What Theta Notation like, Theta Notation,Little-O Notation ,Little Omega Notation means.If possible please give question in simple English rather that Mathematics.Thanks
Please Sign up or sign in to vote.
26 Mar 2012
OriginalGriff
You can't really define these notations in "simple English" - they are complicated mathematical concepts which need precise definitions to show the significant differences.Google: Look at Wiki, and a Wolfram Alpha - they both explain them, but not in simple English!
Please Sign up or sign in to vote.
12 Feb 2014
charles henington
This is an alternative for "Send Mail With Attachment File"
Please Sign up or sign in to vote.
21 Apr 2012
OriginalGriff
We do not do your homework: it is set for a reason. It is there so that you think about what you have been told, and try to understand it. It is also there so that your tutor can identify areas where you are weak, and focus more attention on remedial action.Try it yourself, you may find it...
Please Sign up or sign in to vote.
23 Apr 2012
Argonia
Hello the thing you are trying to write really looks like a DFS(Depth-first search)Depth-first searchbut to complete it you need to use Recursion meaning that the function Route has to call herself. You almost did it :) The problem here is that the algorithm itself isn't what you needDFS...
Please Sign up or sign in to vote.
24 Apr 2012
Nagy Vilmos
You are lucky I'm bored. :)We'll start with the set up; first of all you'll need the player and nodes. You can't have a simple reference to another player as the noe also has an attribute - length.I have missed a lot of code here, but make sure that the two players on either side of the...
Please Sign up or sign in to vote.
2 May 2012
Sergey Alexandrovich Kryukov
The question is not really correct. First, the criterion "most secure" can not be strictly defined. Moreover, suppose you have some secure algorithm, without a flaw like a backdoor, which can use different hash sizes, a hash sizes being a parameter. You can always make it more "secure" by...
Please Sign up or sign in to vote.
17 May 2012
Wendelius
The quality of the proposed words highly depends on the algorithm you choose. One very straightforward is SOUNDEX[^]. Not sure if that's suitable to your needs, but have a look
Please Sign up or sign in to vote.
17 May 2012
Maciej Los
If you're looking for database algorithm to "catch" bad inputs, see SIMIL[^] slgorithm.
Please Sign up or sign in to vote.
13 Aug 2012
Peter_in_2780
I only read the first solution you linked to, but I'm guessing the other one uses the same mathematicians' shorthand. If you read it carefully, they take the left partition to recurse on, and imply that the same process is done on the right. (In fact, reading it again, they actually state that...
Please Sign up or sign in to vote.
18 Sep 2012
Grant Curell
IP checksum implementation in python
Please Sign up or sign in to vote.
17 Sep 2012
OriginalGriff
We do not do your homework: it is set for a reason. It is there so that you think about what you have been told, and try to understand it. It is also there so that your tutor can identify areas where you are weak, and focus more attention on remedial action.Try it yourself, you may find it...
Please Sign up or sign in to vote.
29 Oct 2012
Guirec
You could try some google search with Lexicology[^] and Semantic[^]and then from a computer science point of view you might want to look at :Inference engines[^]Can have a look at lemmas and morphosyntax as well...I used to be part of a project almost 20 years ago which aim to make...
Please Sign up or sign in to vote.
1 Nov 2012
fjdiewornncalwe
1) Research each item in your list by using the developer's best friend, google.2) Compare the data that you acquire in step 1.3) When your question is more specific, ask that here and we will be more then happy to help you out.Cheers.
Please Sign up or sign in to vote.
3 Nov 2012
Thomas Daniels
Hi,Read this:http://www.cs.cmu.edu/~adamchik/15-121/lectures/Trees/trees.html[^]
Please Sign up or sign in to vote.
7 Nov 2012
Roger Doss
The algorithm described herein is designed to implement sorting of variable length strings in O(n) time.
Please Sign up or sign in to vote.
12 Nov 2012
NKlinkachev
For real life currencies and notes: their values are designed in such a way that you can get the value of the next higher note using lower value notes so Solution 1 is the best one in this case. It is not always the case however for any combination of note values. Consider the case where you...
Please Sign up or sign in to vote.
23 Nov 2012
André Kraak
This article Generation of n Digits of the Golden Ratio (Phi)[^] should help.
Please Sign up or sign in to vote.
14 Dec 2012
YvesDaoust
Your problem statement is very messy and difficult to follow.My understanding and formalization are as follows:Assume you are in state [x, y, z]. Here are the possible transitions:Fill 12 -> [12, y, z]Fill 8 -> [x, 8, z]Fill 3 -> [x, y, 3]Empty 12 -> [0, y, z]Empty 8 -> [x,...
Please Sign up or sign in to vote.
26 Dec 2012
khosro moradaliyan
1 alternative  
routing with genetic algorithm C# or VB samplehelp me
Please Sign up or sign in to vote.
27 Dec 2012
Dave Kreskowiak
The question doesn't make sense.What algorithm??Are you asking how to decrypt the data? Without knowning how it was encrypted you're not going to be able to decrypt it.Are you asking what the meaning of the data is? Without the documentation on it, it's just a bunch of giberrish.
Please Sign up or sign in to vote.
1 Feb 2013
Andreas Gieriet
See Robert Sedgewick[^]'s book list: Part 5: Graph Algorithms is the book to read (you choose: C, C++, Java). It would be a nice exercise if you write all the code of the book in C#. ;-)CheersAndi
Please Sign up or sign in to vote.
18 Feb 2013
Andreas Gieriet
If you want the best solution, you need to evaluate all permutations.Often, a good enough solution is sufficient.If you can define a "good enough" criterion, you can define a break condition to stop searching.E.g. (pseudo code):iteration = MaxIterations;best = none;while...
Please Sign up or sign in to vote.
28 Feb 2013
Coding123456
2 alternatives  
Hi all,I am trying to write a program that simulates scanning pages one side then the other to simulate a duplex scan and then reorder the pages into their logical sequence. For exampleif I scan a bunch pages in the order 1,3,5 then the other side 6,4,2. The second scan you flip the...
Please Sign up or sign in to vote.
29 Apr 2013
Thomas Daniels
Quote:I now have a good idea about it but I want to test an example from the link.At the top of the article, there are some download links to download source, demo ...Quote:How can I do that and what I should have in order to run the example code? Ask this question to the author. At the...
Please Sign up or sign in to vote.
19 Jun 2013
OriginalGriff
How large?If it's a couple of megabytes, then try just using Split and Sort: Stopwatch sw = new Stopwatch(); sw.Start(); string s = File.ReadAllText(@"D:\Temp\MyText.txt"); string[] data = s.Split(' ', '\n'); Array.Sort(data); ...
Please Sign up or sign in to vote.
22 Jun 2013
Radu-Stefan Zugravu
1 alternative  
Hi,I am trying to write an algorithm to find a path (not necessarily the shortest one) between a given start and end point.An user will enter the start location, the end location and the available time to travel. For each eadge of my graph I know the cost in time to traverse that edge...
Please Sign up or sign in to vote.
26 Sep 2013
Kosta Cherry
Thanks to CPallini, who gave me a good hint, I came up with this function if anyone is interested. (This is first, rough code, but it produced exactly what I was looking for):void scaleXLn(std::vector& data, std::vector& result){ size_t oldSize = data.size(); size_t...
Please Sign up or sign in to vote.
22 Nov 2013
Mehdi Gholam
Start here : hOOt - full text search engine[^]
Please Sign up or sign in to vote.
25 Nov 2013
Jackie00100
2 alternatives  
Hi I'll try to keep this short,So I'm working on a Cinema booking system and it is time for me to think of an algorithm to decide the "best" place(s) in the Cinema. I've been thinking of maybe using a BFS but jumped to the conclusion that this may not work as each hall may vary in size, on...
Please Sign up or sign in to vote.
25 Nov 2013
BillWoodruff
I'd suggest you start with this CodeProject article "Fast Optimizing Rectangle Packing Algorithm for Building CSS Sprites" by Matt Perdeck: [^]. The article contains a good overview of the packing problem, and goes on to develop, and improve, an algorithm.The "Nuclex" rectangle packing...
Please Sign up or sign in to vote.
11 Dec 2013
OriginalGriff
Perhaps, before you try to get us to do your homework for you you might want to sit down and think about how it makes you look when your "question" to us consists of "here is my homework question - go look at it and give me an idea".For my perspective, it looks like someone too lazy to even...
Please Sign up or sign in to vote.
27 Feb 2014
Stefan_Lang
Basically it's:1. Permute your pixels by first rotating each row and column by some steps2. Encrypt each pixel using XOR (probably this step is meant to obfuscate the permutation from step 1)3. Repeat a couple of timesThe algorithm uses a "seed" of (number of columns + number of rows...
Please Sign up or sign in to vote.
20 Mar 2014
Pascal-78
I think you need the number of integer between the first integer after sqrt(first) and before sqrt(last).To get the first integer after, you can use Math.Ceiling.To get the first integer before, you can use Math.Floor.Then the complete formula should be :Math.Floor(Math.Sqrt(last))...
Please Sign up or sign in to vote.
31 Mar 2014
Dave Kreskowiak
Well, several searchs doens't come up with one, so I guess the answer is "No".
Please Sign up or sign in to vote.
12 Apr 2014
CHill60
Have a look through this list of links https://www.google.co.uk/?gfe_rd=cr&ei=kmlJU9emGafY8gf48YHIDw#q=simulated%20annealing%20algorithm%20formula[^]I would suggest staying on the first page of links or using more information to improve the filter ... 1.17million hits is a bit too much to go...
Please Sign up or sign in to vote.
10 May 2014
Peter Leow
There is no sorting on hard disk, what ever sorting of files you see on the screen is the work of some software such as the OS. Refer:1. About hard-disk[^]2. how-data-is-stored-in-your-hard-disk[^]
Please Sign up or sign in to vote.
4 Jun 2014
Sergey Alexandrovich Kryukov
It looks like a school assignment, and the problem is not clearly and fully defined, so, sorry: no complete solution for you.The question simply makes no full sense. List is irrelevant. If you select some subset of n
Please Sign up or sign in to vote.
22 Jul 2014
Stefan_Lang
It may help to first look at the easiest non-trivial case, i. e. n==2. The function you are looking at maps 2-space to a real number, and if you combine the result y with the argument vector (x[0], x[1]), you get a point in 3-space, (x[0], x[1], y). What you have, now, is a surface. For n>2...
Please Sign up or sign in to vote.
12 Aug 2014
CPallini
You should first learn the basics of the C++programming language (for instance, you cannot ignore '*' and '->' operator meaning) and then try to understand the algorithm.