3,815 Topics
![]() | |
1. .......Algorithm to find the first n Hardy-Ramanujan numbers.... since 1729 is the least ..... I request to post the solution for this............ | |
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, … | |
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 … | |
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 … | |
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 … | |
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> … | |
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 … | |
[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(), '-'); … | |
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 … | |
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 … | |
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] … | |
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("") … | |
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. … | |
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 … | |
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 … | |
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. | |
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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
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 … ![]() | |
[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} … | |
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 … | |
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 … | |
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) { … | |
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 … | |
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> . … | |
Hi frnz, i want to know which is the fastest algorithm for to sort the text file of 1MB , 10MB , 50MB . Thanks in advance | |
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. | |
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 … | |
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? | |
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 … | |
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 … | |
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 … | |
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 … | |
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 ^ … | |
[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 … | |
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 … | |
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; … | |
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 … | |
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 … | |
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 … | |
[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 … | |
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 … | |
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 … | |
[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 … | |
[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 … | |
This is a function that will find the factors of a given number for you. EDIT: Better algorithm using vectors (thanks all at cprog :) ) |
The End.