405 Topics

Member Avatar for
Member Avatar for Narue

Consider the following program and input file: [code] #include <algorithm> #include <cstdlib> #include <ctime> #include <functional> #include <fstream> #include <iostream> #include <iterator> #include <string> #include <vector> #include "natural_compare.h" struct natural_less: std::binary_function<std::string, std::string, bool> { bool operator()(const std::string& a, const std::string& b) { return natural_compare(a, b) < 0; } }; std::vector<std::string> …

Member Avatar for dusktreader
7
2K
Member Avatar for corby

[U]for[/U] i<-1 [U]to[/U] n [U]do[/U] [INDENT][U]for[/U] j<-1 [U]to[/U] n^2 [U]do[/U][/INDENT] [INDENT][INDENT]write(i*j)[/INDENT][/INDENT] [INDENT][U]end-for[/U][/INDENT] [U]end-for[/U]

Member Avatar for corby
0
125
Member Avatar for c_Newbie

Hi everyone, I hope im posting in the right section. I'm desperate searching for an algorithm which tells me the similarity between two java codes. Some kind of anti-plagiarizer. The algorithm I found were mostly written in languages like C# .. I'm trying to write it in PHP, even though …

Member Avatar for pritaeas
0
116
Member Avatar for coffee_bean

Happy new year and peace to you all! Can you please explain to me what is the execution time T(n) of the 2 algorithms? Algorithm 1: for i ← 1 to n do for j ← 1 to i do for k ← j to i+j do a ← a …

Member Avatar for Salem
0
107
Member Avatar for Nerathas

Hello, I have this program that simplifies a fraction by calculating the greatest common divisor. So the fraction 8/4 (largest common divisor = 4) 8/4 4/4 => result would be 2/1 (fraction simplified) My problem is my method calculated this greatest common divisor. But now that value has to be …

Member Avatar for ddanbe
0
159
Member Avatar for swinefish

Hey all I'm trying to write a Multiple Document Summary (MDS) system as proposed by Chali et al. (2009), see attached. And after a lot of reading I've managed to wrap my head around a lot of the concepts. However, one of the things I need to make is a …

Member Avatar for jk451
0
142
Member Avatar for ddanbe

Whenever you hear the word recursion, factorials or Towers of Hanoi are never far away. Well here they get mentioned, because we are not going to talk about these guys at all! Iteration and recursion are in fact quite similar: they both loop until a certain condition is met. As …

2
3K
Member Avatar for newsguy

I can't say I have ever heard of pussy power being used as a driver for advanced chip technology development, but that's precisely what researchers at IBM are claiming. A team of boffins at IBM have been speaking about how they have arrived at something of a milestone breakthrough: a …

1
232
Member Avatar for Benderbrau

Hi guys, I've searched this, but can't find a solution. Basically what I'm doing is writing a binary search tree (which works) and balancing it with AVL (which almost works). As far as I can tell my AVL tree is implemented correctly, but I'm getting a stack overflow error at …

Member Avatar for Geekitygeek
1
571
Member Avatar for delia29

Hi, im new at computer programming and i need help to do the following algorithm. The algorithm must be in both pseudocode and flowchart. Please help. Thanks!  Calculate the weekly salary of employees for a given number of hours each employee worked for the week.  The NAME and …

Member Avatar for iamsmooth
0
103
Member Avatar for wil0022

Hi can anyone help me doing a binary search..? example: the number of input is 10. then the inputted number 20, 10, 90, 23, 21, 32, 87, 45, 76, 56 search value: 32 output: Lower: Middle: Higher: Value not found! (Until the value found or the loop end) sorry for …

Member Avatar for kvprajapati
0
136
Member Avatar for Cory_Brown

Thank you in advance for any help here. This is my first post and I will try to phrase what I am thinking. I am trying to validate the entry of a field based on entry in a second field. If field "A" has value 1, 2, or 3 then …

Member Avatar for Cory_Brown
0
116
Member Avatar for happygeek

There’s a serious amount of money to anyone who can prove that the answer is yes, and rather surprisingly it is online DVD rental service [URL="http://www.netflixprize.com/index"]Netflix[/URL] that is posing the question and providing the cash. It all revolves around the movie recommendation system that Netflix developed, CinematchSM, that can predict …

0
144
Member Avatar for ddanbe

Although there is little need for any sort algorithm in C#. Every collection class has a sort method, so why would you wanna write one for yourself? My guess to learn and see how it is done. Well her are implementations of two popular sorts. The arrays are integer but …

Member Avatar for subtercosm
0
833
Member Avatar for ddanbe

Most of the time there are many ways to implement an algorithm. Here are two ways to implement the greatest common divisor algoritm, one of the oldest algorithms ever.

0
404

The End.