3,815 Topics
![]() | |
I need to make a sorting algorithm. The program takes an input file that stores the information into an array: the array has student's name and a personality type. The personality types are: enum values Realistic Artistic Social Conventional Then once it takes an array, it sould divide the main … | |
I'm suppose to do this using sorting algorithm..so it asks to creat a friends database application that maintains a file of friend objects that contain names, telephone numberrs, and email adresses..etc. The friends application should load friend records from a file and then allow the user to add new friends, … | |
Hey guys. I apologize for my sloppy code. But it got a bit longer than i expected so i stopped bothering about giving meaningful names to Variables later on in the program. Below I have a AVL tree(atleast that's what I intended to write). But my approach to it was … | |
I'm trying to implement the algorithm described here under 'definition', [url]http://en.wikipedia.org/wiki/Laguerre%27s_method[/url] To summarise it takes an initial guess 0, and then iterates to find the root. In lines 68 to 71 I was hoping this would exit the function, i.e. when the root is found...but it's still carrying on. Can … | |
Me and a friend have been trying desperately to get this done, but we barely know where to start. We know we need the ifstream to read in from the file, but that's about it. Anyone got any tips for us, please? (Note: we're both fairly new to programming, so … | |
Hello all, i've tryied to setup a mail server using thise guide: [url]http://www.debianadmin.com/debian-mail-server-setup-with-postfix-dovecot-sasl-squirrel-mail.html[/url] I can easily recieve it, but have problems sending it. My main.cf : [code] biff = no append_dot_mydomain = no readme_directory = no smtpd_tls_cert_file=/etc/ssl/certs/ssl-cert-snakeoil.pem smtpd_tls_key_file=/etc/ssl/private/ssl-cert-snakeoil.key smtpd_use_tls=yes smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache myhostname = server alias_maps = … | |
Hi, I've read the rules for this website and i'm aware that we should not expect people to do our homework. But I really need help on this program.. and I'm not sure how to start it, and it's last minute help please. I'm suppose to do this using sorting … | |
The Question is : Three stacks can be used to sort a list of numbers. Assuming stack in holds the input list of numbers, stack out is to hold the output list after sorting the numbers and temp is used during the sorting process. The sorting algorithm follows. 1 set … | |
Hi, would someone please help me with the following: I would like to implement the Round-Robin scheduling algorith for the below code. I am really facing a problem whenever i try to implement Round-Robin scheduling algorith in this code. Your prompt action and support is highly appreciated and I am … | |
Hello Friends! As the topic name is clearing, I need help regarding how this "Fibonacci Search" works? [B]The basic concept behind introducing this Fibonacci Search?[/B] [U]I neither want replies telling it's based on Fibonacci Series nor the code but the actual logic behind it.[/U] As of now I've clearly understood … | |
Hi, Its my first project. I have to develop a c program which can balance a chemical equation by the method of 'Generalized matrix inverse method for balancing chemical equation and their stability'. But I am using a little different method. where I am not able to find complete step … | |
According the exercise, which makes us practice with vectors, i am supposed to write a program that allows the user to enter his/her favorite games, view them and remove any he likes. Obviously, to remove a piece of text, it has to be of the same case as the one … | |
My program deals with the Genetic Algorithm and Hill Climber Algorithm. I have a program that compiles without any errs, its just the data is gives is incorrect. I explain my error on the bottom part of my post Header File [CODE]#include <iostream> using namespace std; //------------------------------------------------------------------------------ template<class T> class … | |
![]() | ok.. its really hard and takes time and knowlage of C++.. i hope i am in the right section for this.. if no please the mods move it to the right one.. Whoever manage to make over it... is god for me. i can give one premium rs account valid … ![]() |
Hi guys, I'm trying to write a small program which will search a file for few bytes and replace it with another bunch of bytes. But everytime I try running this small app I got message about [B][I]istream_iterator is not dereferenceable[/I][/B]. I'm even not sure that I know how exactly … | |
I have to write a program that allows a user to pick five numbers from one to 55. The computer will then generate 5 random numbers and determine how many of the users choices match the generated numbers. I have to create an algorithm for this program. The program will … | |
[CODE]#include <cmath> long double NR(long double sample) { return (abs(f(sample)))<=1e-10 ? sample: NR( (sample - f(sample)/fp(sample))); } long double f(long double sample) { return 2.5*exp(-sample)-3*sin(sample); } long double fp(long double sample) { return -2.5*exp(-sample)-3*cos(sample); }[/CODE] I'm trying to write code for a Newton-Raphson algorithm. I have it in recursive form … | |
Hi there daniweb, i'm making a program that deals with a hill climber and genetic algorithm. I'm pretty much done writing the code but i'm having a headache of a problem....heres the header[CODE]#include <iostream> using namespace std; template<class T> class myVector { public: myVector(); int get_size() const; int get_capacity() const; … | |
[CODE] public void EncryptFile(string input, string output,RijndaelManaged alg1) { FileStream inputStream = new FileStream(input, FileMode.Open, FileAccess.Read); FileStream outputStream = new FileStream(output, FileMode.OpenOrCreate, FileAccess.Write); SymmetricAlgorithm alg = new RijndaelManaged(); alg.Key = alg1.Key; alg.IV = alg1.IV; byte[] data = new byte[inputStream.Length]; inputStream.Read(data, 0, (int)data.Length); alg.Padding = PaddingMode.PKCS7; ICryptoTransform encryptor = alg.CreateEncryptor(); CryptoStream … | |
[B]This is The function i have written to get waiting times of processes some one please help me to solve this[/B] [code] class NonPreemptive { public: int* getWaitingTime(int* process, int* arrivalTime, int* burstTime, int nProcess) { int ct[5],temp,j; int* wt = (int*)malloc(sizeof(int)* 5); wt[0]=0,j=0; for(int i=process[j++];i<=nProcess;i++) { if((arrivalTime[0]==0)&&(arrivalTime[j]<arrivalTime[j+1])&&(0<burstTime[j]<10)) { ct[i]=arrivalTime[i]+burstTime[i]+wt[i]; … | |
I'm supposed to get a 4-digit number from the user, convert it to binary (and hex), then print it out. I have absolutely no idea where to start. I know the algorithm; taking the number, diving it by 2, repeat until the number reaches 0 and the remainders of everything … | |
I built this entire program and it does what I want it to except I want to use a bubble sort algorithm instead of the [CODE]std::sort()[/CODE] function I have right now. So please help me out on this. I don't really understand how bubble sorts work even after reading up … | |
I'm trying to run my program but i can't find out why its giving me a segmentation fault. Please Help. [CODE]#include <cmath> #include <cstdlib> #include <ctime> #include <string.h> #include <fstream> #include <sstream> #include <stdexcept> #include <stdio.h> #include <ctype.h> #include <vector> #include <cctype> #include <algorithm> #include <iterator> #include <iomanip> #include <cstdlib> … | |
hi, Can any one help me about clock problem..i need to calculate the exact execution time of algorithm using the processor clock speed not the wall clock time..i am getting zero by using the clock_t function in time.h.also how can i calculate the exact processor speed execution of program..reply me … | |
Hi, I was wondering if anyone can help me translate this into java. Thanks [CODE]#include "Element.h" #include <stdlib.h> element * Element(int s1, int w1, double c1, int x1, int k1) { element * retval = malloc(sizeof(element)); retval->s = s1; retval->w = w1; retval->c = (float) s1 / (float) w1; retval->x … | |
![]() | hey everyone.. I need to find an algorithm that runs a search in a rundomly made binary tree that holds the keys 1 to n and looks for a [B]subdomain[/B]..let's say I'm looking for nodes between the keys 4-30. I can't find any example codes on the web or explanations..even … ![]() |
I wrote my own sha implementations but i cant get them to read files correctly. i know to use [CODE]open(file,'rb').read()[/CODE] as the input into the algorithm, but [CODE]import hashlib hashlib.sha1(open(file,'rb').read()).hexdigest()[/CODE] and my code [CODE]sha_1(open(file,'rb').read())[/CODE] return two different hashes. any idea why? i know that a normal string will have the … | |
Hi everyone, I'm having problems on my current project. The project consists of optimizing a given function using either the Hill Climber or Genetic Algorithm. The functions I'm going to be optimizing are the Schwefel, Rosenbrock, and Griewangk problems defined here [URL="http://www.cs.cmu.edu/afs/cs/project/jair/pub/volume24/ortizboyer05a-html/node6.html"]http://www.cs.cmu.edu/afs/cs/project/jair/pub/volume24/ortizboyer05a-html/node6.html[/URL] My code for each of the three function … | |
Hey guys I have a couple of questions. I am trying to build a program that will prompt for the user to enter the size of an array. I've searched the web and several C++ books for guidance on this but have not been able to find anything of significant … | |
hi frndz... here's a very small doubt that's been lingering for a while... what is the meaning of finding an algorithm for a certain problem in constant space?? i dont understand the meaning of constant space, does it mean that no temporary variable can be created? for ex:here's a question... … | |
HOw does interpolation search work, help me with how you end up with log(logN) | |
I'm making a header file to make, sort, and print a vector using heapsort. I keep getting a compiler error about my const char[100] array. Probably something really simple I'm missing...I hope. In function `void build_list(std::vector<T, std::allocator<_CharT> >&, const char*)': 16 expected primary-expression before "const" 16 expected `;' before "const" … | |
Does anyone know where I can have access to SHA-2 algorithms? Preferably, in Java but C can also do. Thanks | |
So we have to implement Bresenhams line drawing algorithm as well as Cohen-Sutherland line clipping algorithm. For some reason my whole program (9 classes, but only will include Line.java here) runs fine, but the output .xpm file contains a picture that is not what it's supposed to look like from … | |
Hi! I need a bit of help with an array sorting issue. I would like to sort the contents of an array (double type values) in ascending order. The problem is that the array size is unknown - the array itself is the result of another algorithm carried out within … | |
Hello programmers, I need someone to give me just hint of how to design an algorithm to the following problem: Suppose you have three types of fax machine: 1. Super fax with the features: colored, high quality and double sided. 2. Colored fax with the features: colored and high quality … | |
hi.. All though this type of thread is already available, I'm re-posting, just because I wanna have some more details. I wanna create a new Prog language . I give input as a abstract sentence. Eg Input : Let A be 10 , B be 10 . C be Sum … | |
Okayy, So. I'm required to make a new set of functions for the <string.h> library and am confused on a few things, and am wondering if anyone can help me out. I'll toss out the ones I'm struggling with. int mystrcmp(const char* s1, const char* s2); This function will compare … | |
Hello. Here is my homework problem: I have a set of numbers for which i have the inorder and preorder traversal. I need to construct a binary tree from those. I have most of the code written i just need some help with a specific part. I have heavily commented … | |
So I have these nodes I'm trying to sort as such, but it's not working. This is psudo code: Node first = new Node(23); //previously construted node [code] put method(newNode) { Node traverseInOrder = first; while (newNode > traverseInOrder) { If (traverseInOrder.successor != null) { traverseInOrder = traverseInOrder.successor; } else … | |
Hello HELP :( Ok I have an assignment due in 5 days. I have done [B]everything[/B] except for one function. This function finds the smallests factors of a positive int & it multiplicities, Have I lost you yet, dont worry because I've been lost for a week now with this … | |
Okay, the encryption algorithm idea was stupid. But I still made an encryption program. I got the absolute most possible frustrating situation. The program doesn't work in the console window. It spits out a giant error (probably recursion judging how many errors it got), but it DOES work in IDLE. … | |
Hi guys, anyone familiar with the Markov Chain Algorithm? I've got an assignment to take the code from a C++ implementation and remove any stl features like deques and maps, but continue to use strings as my main object type. I've based my changes around a C version of the … | |
In computer science, an LR parser is a parser for source code written in a computer language that reads input from Left to right and produces a Rightmost derivation. The term LR(k) parser is also used; where the k refers to the number of unconsumed "look ahead" input symbols that … | |
I am interested in learning python and picked up a friends textbook to try and work through it. I have no cs experience so am pretty clueless. I am having difficulty with one of the problems in the first chapter lol. i am trying to make the program spit out … | |
Hello, I am having a difficulty in passing a barrier of JAVA graphics generating. I hope you could explain some things to me, cause I have noone to help me and it is hard to get help in internet, because I feel like missing something important. The thing is I … | |
There is little doubt that one of the most daunting tasks in all of computer programming is that of developing your own algorithms. Indeed, it is here where the term Computer Science comes to the fore as it is virtually a step-by-step process, so intricate and precise it truly is … | |
hello, I am interested in implementing the push relabel max flow algorithm in C++. I see an implementation at [url]http://www.boost.org/doc/libs/1_40_0/libs/graph/doc/push_relabel_max_flow.html[/url] and don;t understand a good bit of it. I am in a position to describe my graph and if someone could explain how I can use this piece of code, … | |
How can i sort this array pls.. [CODE]#include<iostream> #include<algorithm> using namespace std; int prompt(int x[]); void printreverse(int x[]); int main() { int x[5]; prompt(x); printreverse(x); system("pause"); return 0; } int prompt(int x[]) { for(int i=0;i<5;i++) { cout <<"Enter integers:"; cin >>x[i]; } } void printreverse(int x[]) { for(int i=0;i<5;i++) { … | |
Hi everyone, Well I come to a point that I have run out of ideas and time and I’m going to ask for help from anyone that can help. I hope that there will be someone that could give me a hint how to solve my problem. About my problem … |
The End.