3,815 Topics

Member Avatar for
Member Avatar for ram.patil

1. .......Algorithm to find the first n Hardy-Ramanujan numbers.... since 1729 is the least ..... I request to post the solution for this............

Member Avatar for TrustyTony
0
2K
Member Avatar for MarvelWolverine

Hi, I am writing a program to solve the 8puzzle, but for some reason i am having more difficulty with the structure than the algorithm.... I have two classes, a tree and node class. My main problem is to put the nodes in an array in the tree class. Second, …

Member Avatar for Narue
0
315
Member Avatar for HelloMe

Hello everybody...!!! I got a little but bothering problem. I create a First in First out algorithm schedule but somehow i have a problem in computing the WT(Waiting Time). Actually i have a WT but it only considers the current AT(Arrival Time) of the current process and does not include …

0
87
Member Avatar for aravinda reddy

I have to find the maximum total price for the list of items so that weight should not exceed 14285 and volume should not exceed 17.. I need the best algorithm to find this.. The structure look like this wmax= 14285 vmax= 17 item weight volume price ============================== 1 1190 …

Member Avatar for Momerath
0
134
Member Avatar for tomato.pgn

I m developing an application on peer to peer network.... This is my requirement... Over the course of four milestones, you will create from scratch a P2P system, that [B]• creates a network of many peers • self-organises the network into an overlay structure reflecting the strengths of the individual …

0
74
Member Avatar for Clinton Portis

Trying to make a quick little tool in response to the [URL="http://www.msnbc.msn.com/id/42348642/ns/technology_and_science-security/"]FBI's request for assistance[/URL] on cracking a code.. getting an error that takes me outside the scope of my program.. not sure what is causing the problemo. Maybe another set of eyes can help: [CODE] #include <iostream> #include <fstream> …

Member Avatar for Clinton Portis
0
245
Member Avatar for jalpesh_007

I have made floyd warshall algorithm. I need some help for finding shortest path from source to destination. We have to give source and destination. Eg. Program gives us output like source=A and destination=D then shortest path is A-B-D with distance 10. I also give the code for that in …

Member Avatar for rubberman
0
371
Member Avatar for Khoanyneosr

[CODE]// Hangman Redo Program #include <iostream> #include <string> #include <cstdlib> #include <ctime> #include <string> #include <vector> #include <algorithm> using namespace std; //Functions void instructions(); void game(); // Types and Arrays string choice; string inst; const int MAX_WRONG = 8; vector<string> words; const string THE_WORD = words[0]; string soFar (THE_WORD.size(), '-'); …

Member Avatar for jonsca
0
166
Member Avatar for jmcginny5

So I have the program written, but for some reason, when I go to compile it, the display box pops up and then disappears right away. Can you please help me to figure out what I did wrong? [CODE] #include <iostream> #include <iomanip> #include <cmath> #include <string> #include <fstream> using …

Member Avatar for zaneulhaq
0
100
Member Avatar for eman 22

I'm working in a program which compress a file I decided to use the huffman algorithm to encode (the Bytes Or character) but huffman algorithm depends on the frequency of each letter and If I calculate the frequency for each letter, it will takes long time. so what should I …

Member Avatar for Momerath
0
93
Member Avatar for ydan87

Hello everyone, Please see the questions below and try to help me solve them. 1) Given an array of n elements, for each of the following cases suggest an efficient algorithm for computing in sorted order the k minimal values: a. k = n / 2 b. k = [TEX]sqrt{n}[/TEX] …

Member Avatar for Momerath
0
453
Member Avatar for udinnet

I made my own program for N-queen problem (A popular algorithm in Data Structures). Check this code and post your suggestions. If you have any ideas for the improvement of algorithm speed, please post here. Thanks. [CODE] #include <stdio.h> #include <stdlib.h> //N-Queen Chess problem solving Algorithm// //Note:- Uncomment The printf("") …

Member Avatar for Adak
0
520
Member Avatar for gaurav_13191

I am trying to find out inorder successor of a node in a binary search tree. I read the algorithm from "Introduction to Algorithms,Cormen" and understood it. But the problem I face is that I can't find out the parent of the node when it is needed in the algorithm. …

Member Avatar for thekashyap
0
426
Member Avatar for Kase42

Hey everyone. I am attempting to create a simple console maze generator in C++ for a school project. I've already gotten most of it down but I'm having a problem debugging the actual generation algorithm I've implemented. I've been learning C++ for the past few months now but I haven't …

Member Avatar for Kase42
0
2K
Member Avatar for da10x

Hi, I have to make a linked-node based priority queue for an assignment. For some reason, however, the enqueue and dequeue just won't work. I have honestly no idea why, because I think the algorithm should work. Can anyone point out the problem? It would be greatly appreciated. [CODE] public …

Member Avatar for da10x
0
86
Member Avatar for drogba123

Hi, i want to write an algorithm to list out possible paths in subway train maps from one station to another station (A to G). I am planning to use the breadth first search. Is it good? Thanks.

Member Avatar for CrazyProgrammer
0
63
Member Avatar for negneg

Hi I wrote a code for Galerkin Finite Element .The program runs with no error but have some problem breaking the loop also the results are all wrong .Can anyone please help me? This is my first time writting aprogram and I am so confused. #include<stdio.h> #include<stdlib.h> #include<math.h> #define Limit …

Member Avatar for frogboy77
0
179
Member Avatar for Asif_NSU

Gaussian elimination is designed to solve systems of linear algebraic equations, [A][X] = [B] This program reads input from a file which is passed as an argument when calling the program. Say the matrix is in file name matrix.txt so we call the program in this way: ------------------------- gauss matrix.txt …

Member Avatar for xNourax
0
1K
Member Avatar for Kunal Aggarwal

I made the Huffman code algorithm... and made the tree as it should be made.. The problem comes how do I print the code from the tree.. Theoretically I know the code generation.. But how to implement in C++.. Using TC. The following tree is constructed for this data [CODE]Alphabet …

Member Avatar for Kunal Aggarwal
0
152
Member Avatar for ddcc

Hi, i am trying to write a program which calculates the sum of the prime numbers below a specific limit using an algorithm called the Sieve of Eratosthenes(Wikipedia it). I am getting an error though when i run my program. It says debug assertion fail and something how the iterator …

Member Avatar for ddcc
0
170
Member Avatar for Despairy

im looking for a more efficient algorithm, is there any known one? ive checked my math books and c++ book and really didnt find anything more efficient than the following : [CODE] int first_prime(int num) { for (int i=2;i<sqrt(num);i++) { if (num%i==0) { if (isprime(i)); return(i); } } } bool …

Member Avatar for Despairy
0
1K
Member Avatar for SwethaSuresh

Can anyone please solve the following problems in C ASAP its verymuch urgent 1. C program to check whether the given graph is tree. 2. C program to check whether the Binary tree is full or complete or neither full nor complete 3. C program to extract spanning tree(without using …

Member Avatar for yan0
0
99
Member Avatar for BevoX

Alright no more prime number generators I promise, but I had to fix the last one... This one uses the Sieve of Eratosthenes algorithm. It can generate prime numbers even faster, than the previous version. 1 million prime number in 2,331 second, ten million prime number in less than 22 …

Member Avatar for KumarUtkarsh
0
156
Member Avatar for coderN

[B]I am stuck at a program, where I have to print all the subsets of a given arguments, I printed n-binary digit using recursion but i cant not use the same algorithm. ..lets say % java SubSet acd {,a,c,d } which will print {a} {c} {d} {a,c}, {a,d}, {c,d}, {a,c,d} …

Member Avatar for JamesCherrill
0
42
Member Avatar for littleleaf

Hey guys, I am writing a C++ program with the help of dynamic allocation of a character array. The size of the array depends on the size of file read. However, when I checked the size of allocated array, it is always 4! So, is there any limit on this …

Member Avatar for jonsca
0
172
Member Avatar for cyman29

Hey this is from my c++ assignment at Uni. I'm fairly new to programming so i need some help. The program has separate functions after the main() which i have to call everytime i need to use them. So I've sorted an array using a fuction with an algorithm of …

Member Avatar for mike_2000_17
0
193
Member Avatar for lxXTaCoXxl

Okay so I've been trying for a few days now and just can not seem to figure this algorithm out. Right now I'm trying it with a while loop but still not working. Basically here is my snippet. It's on a timer for 10ms. [CODE]void colorScrollRotation(object sender, EventArgs e) { …

Member Avatar for lxXTaCoXxl
0
145
Member Avatar for flyboy567

Hi, Ive written a program which is capable of sorting an array of ints e.g. array[6] = {4,6,-1,0,6,4} however i want to expand this so it will be able to order chars as well. With my code as it is, it will order chars correctly i.e. sort the numbers out …

Member Avatar for mike_2000_17
0
158
Member Avatar for Sc@recrow

As part of an assignment, we have to write a Quicksort algorithm, and then verify it's time complexity. I am trying to time how long it takes to run the quickSort function, but it keeps returning 0. Here is a snippet of the code [CODE] . . #include <time.h> . …

Member Avatar for rubberman
0
130
Member Avatar for virendra_sharma

Hi frnz, i want to know which is the fastest algorithm for to sort the text file of 1MB , 10MB , 50MB . Thanks in advance

Member Avatar for virendra_sharma
0
112
Member Avatar for geekme

Hey, I know the algorithm for a network router but do not know how to implement in coding.Kindly help me with the coding part. Regards.

Member Avatar for L7Sqr
0
110
Member Avatar for hitchiker

HI all, I have been working on fuzzy logic since some time now and have been developing models using matlab fuzzy logic toolbox. Now however I am trying to work on c# platform. The problem with me is that the no of rules i have is in hundreds and earlier …

Member Avatar for ryxcy
0
451
Member Avatar for dresposure

Hello everybody.... I am presently doing a project which involves secure file transfer. I want to implement The Tiny encryption algorithm in it(TEA). However I donno how it works.:(.......... Can anyone explain how it works?

Member Avatar for rubberman
0
333
Member Avatar for blueRo

hi all,, in my project, i have to use matching between two ranked lists, one for student, he choose 6 wanted project (by rank), that he want to assign, and the other list is for the project, where the supervisor can choose 6 student (by rank).. then after all choices …

Member Avatar for rubberman
0
400
Member Avatar for Annuate

Hi I'm looking for a bit of direction for solving a problem. Just a bit of back story, my professor gave us a project of Building a tree, and using it to evaluate a mathematical expression. As far as the assignment is concerned it was completed but I was looking …

Member Avatar for rubberman
0
160
Member Avatar for cwarn23

Hi, I am rendering a bunch of cg images but now I need to make an applet that will view them. More specifically these images are very much like the first generation of google street view where you have a picture and you can get a camera to crop a …

Member Avatar for mKorbel
0
177
Member Avatar for Poopster01

I have written my first class and I was given a driver program to test my class it might seem silly but how do I run the driver file to test my class Description: Java Class Die that will manage a roll of a six-sided die. The Class will include …

Member Avatar for thekashyap
0
227
Member Avatar for gyuunyuu

I found numerous examples on converting infix expression to postfix expression but my program needs to include some functions like sqrt(x), min/max(x,y), fact(x), abs(x). abs(‐5) is converted to ‐5 abs 120 – (45+3) is converted to 120 45 3 + ‐ (3^2 + 4^5)*fact(3) is converted to 3 2 ^ …

Member Avatar for thekashyap
0
134
Member Avatar for Khoanyneosr

[CODE] // Hangman Redo Program #include <iostream> #include <string> #include <cstdlib> #include <ctime> #include <string> #include <vector> #include <algorithm> using namespace std; //Functions void welcome(); void instructions(); int game(string sofar, const string THE_WORD, int MAX_WRONG, int wrong, string used); // Types and Arrays string choice; string inst; const int MAX_WRONG …

Member Avatar for Khoanyneosr
0
280
Member Avatar for banoo2010

Hello there; I am new to object oriented programming need to use vectors. basically I have data from CSV file and I stored it in a vector. I need to partition this vector to n vectors and I need it to be dynamic. I started using class in order to …

Member Avatar for banoo2010
0
289
Member Avatar for moorekwl92

Hey i'm [B]trying[/B] to write code for a word utility program for a uni project and it is bugging the hell out of me. [CODE]#include <stdio.h> #include <string> #include <iostream> #include <fstream> #include <Windows.h> #include <string.h> #include <cctype> #include <algorithm> #include <vector> using namespace std; const int size=300; int a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,i1,option,Mirrorimage,spacenumber=0,characternumber=0,averagelength=0,Uppercase; …

Member Avatar for rubberman
0
173
Member Avatar for digitup1

I am trying to time the execution of a quicksort algorithm in C++ but for some reason it constantly returns 0 for me, which clearly can't be right! I don't know where I am gooing wrong, so any help would be greatly appreciated!I have the code done for arrays of …

Member Avatar for template<>
0
191
Member Avatar for DrewS

Hello, I am supposed to implement heapsort proposed by floyd. I got it as a home work. I know the simple implementation of heapsort. but what i am supposed to do is- while sorting, instead of comparing 3 values (parent and two childs), i need to compare only 2 child …

Member Avatar for rubberman
0
96
Member Avatar for jacob21

Hi, I am working on PHP mail having an attachement. mail is working fine but not attaching attached document. this is my code [CODE]<?php //define the receiver of the email $to = 'ab@gmail.com';//my email id //define the subject of the email $subject = 'Test email with attachment'; //create a boundary …

Member Avatar for R0bb0b
0
187
Member Avatar for zachattack05

[COLOR="Red"]Disclaimer: [I]First, I'm aware that this is C++ code and this is a C# forum, I'm not all that familiar with C++ and was hoping someone here could explain the example below in C#.[/I][/COLOR] I was browsing the very complex source code of the open source project MySQL and saw …

Member Avatar for CsharpChico
0
798
Member Avatar for QuantuMechanic

Greetings all, I have written the following code to calculate the solution to a system of ODEs, called the Matsuoka equations, by using the Runge-Kutta 4th order method. I am trying to implement this code on an Arduino microcontroller. The output of the equations, IC[0] - IC[2], should oscillate but …

Member Avatar for QuantuMechanic
0
399
Member Avatar for passcode121

Hi, i am having a really hard time solving the following problem. it looks really simple, but i cannot find a good implementation for it !! if you have a good algorithm please tell me about it, thanks The Problem: Source File: coindst.c/ cpp/ pas/ java Input: coindst.in Output: coindst.out …

Member Avatar for passcode121
0
1K
Member Avatar for imhiya

[CODE] #include <iostream> #include <cstdlib> #include <cstdio> #include <fstream> #include <string> #include <vector> #include <sstream> #include <list> #include <limits.h> using namespace std; class Node { public: string name; vector<string> edges; vector<int> dist; }; class Path { public: vector <int> distance; vector <string> fromwhere; vector <int> complete; vector <string> cities; vector …

Member Avatar for rubberman
0
140
Member Avatar for Khoanyneosr

[CODE] // Hangman Redo Program #include <iostream> #include <string> #include <cstdlib> #include <ctime> #include <string> #include <algorithm> using namespace std; //Functions void welcome(); void instructions(); void game(); // Types and Arrays string choice; string inst; int main() { welcome(); return 0; } void welcome() { cout << "\tWelcome to Hangman …

Member Avatar for Narue
0
233
Member Avatar for manutd

This is a function that will find the factors of a given number for you. EDIT: Better algorithm using vectors (thanks all at cprog :) )

Member Avatar for lxXTaCoXxl
0
181

The End.