3,815 Topics

Member Avatar for
Member Avatar for DarkSam

I need help with this problem Generating Random Cities Write a function called generate_cities(min_x, max_x, min_y, max_y, n, distance) that generates a list of cities with random coordinates. The parameters represent the following: * min_x, max_ x: the minimum and maximum values for the x coordinate of each city * …

Member Avatar for Murtan
0
83
Member Avatar for scottyscotty19

Question: Highlight the part of the algorithm detailed in RFC826 which makes Arp Poison Routing (APR) possible and briefly explain your reasoning. I am not 100% sure on this question, what is it asking for? I have read the document RFC826 but still confused. Does it mean this this algorithm? …

Member Avatar for scottyscotty19
0
174
Member Avatar for Kemper

Need help with a problem. Pretty new to this kind of stuff. You require an algorithm that will receive an integer from the screen, add 5 to it, double it , subtract 7 from it and display the final number. Pretty much I am confused what I need to put …

Member Avatar for heathovc
-2
608
Member Avatar for nvodapally

Implement a recursive template function for the 2-way Mergesort algorithm. A Main program is provided that tests this function. Can anybody help me out with this question? this is the main function [code=cplusplus] #include <iostream> #include "Student.hpp" #include "MergeSort.cpp" int main() { const int n=10; { Student A[n]; Student tmpArray[n]; …

Member Avatar for skatamatic
0
79
Member Avatar for hbmarar

Hi, I wanted to make use of a algorithm script for computing scores nd though i started doing it with a single database, i after testing script, decided to get a master and score databases both having same tables and data. I imported 2.5 GB of data dump to both …

Member Avatar for hbmarar
0
196
Member Avatar for demroth

Johnson's algorithm is a way to find shortest paths between all pairs of vertices in a sparse directed graph. The problem is I can not seem to find any good documentation on it nor any code to analyze. I have been to Wikipedia, read some algorithm books and some power …

Member Avatar for nicholasmathew
0
101
Member Avatar for kansurr

I cannot seem to solve this problem. if someone can please help me, i would much appreciate it. thanks [QUOTE]This problem is concerned with how variations of Tomasulo’s algorithm perform when they run a loop that is very common. This loop is a vector loop called the DAXPY loop (for …

Member Avatar for nicholasmathew
0
434
Member Avatar for Foe89

I'm really not understanding what's going on with the array in this. Here's the question. The following code totals the values in each of the two arrays. Will the code print the correct total for both arrays? [code] int total = 0; int count; for (count = 0; count <= …

Member Avatar for ddanbe
0
124
Member Avatar for king_khan

Hello everybody, Please Solve my some problems.I would be very thankful to you. [B]Problem # 01[/B] Show the trace of partitioning algorithm on this array, 5 3 8 6 4 7 3 1 [B]Problem # 02[/B] If you’ve to compare three values i.e. a1, a2 and a3 then make the …

Member Avatar for Ezzaral
0
72
Member Avatar for glecymay

i hope you can help me regarding computing the running time of a program in C++ environment the specification is like this: i will make a program that can read another file which is a program too in C++. I would like to compute the main() alone of the file. …

Member Avatar for dmanw100
0
61
Member Avatar for Antenka

Hello everyone, beforehand, sorry for my english... I have to do client - server application. They must interact, using classes URL, URLConnection. I understand, how to send data to server. But I can not realize server work. The common algorithm of server is: 1. Start. 2. Wait for connection. 3. …

Member Avatar for Antenka
0
203
Member Avatar for skatamatic

Well, this is for the same assignment as my last post. It's just a simple implementation of a bunch of Algorithm functions. It throws a runtime exception at the end saying the stack around the b variable was corrupted! I commented out all the lines with that use the b …

Member Avatar for skatamatic
0
136
Member Avatar for skatamatic

I'm working on an assignment for school where my teacher wants me to convert each member of an array of a class if it's int member is greater than 300. I can make it work for the first value of 300, since that's what find_if returns. But how do I …

Member Avatar for skatamatic
0
190
Member Avatar for JustLearning

I am having a problem writing the last part of my code for this program. There is a DFS function that I need to write that is included in the header file of the graph.h my program. Here is the sample of code that my instructor gave me. [code=c++]template<class VertexType> …

Member Avatar for JustLearning
0
192
Member Avatar for Zach101man

Objective: Write a C program that will accept an infix expression from the user, build an expression tree using the algorithm described in class and then traverse the tree recursively three times to produce the prefix, infix and postfix expressions. Notice that the infix expression produced from the tree should …

Member Avatar for ddanbe
0
104
Member Avatar for c++ prog

hi, we have a simple program here that states like this: [CODE] input >= 10 ex: 12 1 Square Sqrt Cube Fouthroot 2 - - - - 3 - - - - 4 5 6 7 8 9 10 11 12 [/CODE] i made the code already but I still …

Member Avatar for dickersonka
0
87
Member Avatar for afg_91320

im designing a program where it calls a function that uses the linear search algorithm to locate one of the values. function must keep a count of the comparisons it makes until it finds the value. the program then calls the binary search (a sep. function) to locate the same …

Member Avatar for Lerner
0
117
Member Avatar for dmanw100

I'm working on a project for school where we have to read from a voters database which is set up in the following manner: voternumber:voternama:havevoted Ex: 1253:Bill Simmons:false 3244:Steve Jobs:true I made this algorithm to search for a voter by ID number but for some reason it keeps coming up …

Member Avatar for javaAddict
0
103
Member Avatar for AutoC

Hi, I need help with implementing cyclic codes.Its much like crc.I've found a lot of software implementations for crc but havent understood them.I've looked at a crc guide which gave, [code] So to implement CRC division, we have to feed the message through a division register. At this point, we …

Member Avatar for vijayan121
0
158
Member Avatar for abhaydiwan

Problem: I need to read in each line of an input file into an aray of strings.The program should quick sort the array and output the sorted list to a file: I came out with the below code, buts its giving me two error and i need to update it …

Member Avatar for VernonDozier
0
96
Member Avatar for fatnickc

I'm about to start writing a genetic algorithm program which will be able to find the highest/lowest/whatever else values of variables required for an equation, and have come upon a point about which I am uncertain. I do not know whether I should store and work upon the values as …

Member Avatar for fatnickc
0
120
Member Avatar for taylorknox

Could someone please help me im trying to Use the fourth order Runge-Kutta algorithm to solve the differential equation. dy/dx = -y, y(0) = 1 nelow is the program I currently have, and do not know how to corect it, I shouls get altering values of y as x goes …

Member Avatar for ArkM
-1
180
Member Avatar for truebman

I've benn working on this problem for a week. I still can't get it remotely closely to working Can anyone HELP :'( me ---------------------------------------------------------------------------- The task is to write a program which reports the amount of time required by various sorting algorithms to sort different numbers of data values. Then, …

0
60
Member Avatar for JpegUser

Hi all, Just a simple question. How do i reverse a pointer to a set of values given that i know the size of the pointer? Eg int *temp = malloc(ptr_size); // values of *ptr let say is 1......100, // if i use the algorithm below, it gets me 1..50...1 …

Member Avatar for JpegUser
0
126
Member Avatar for papuccino1

On the click event of the picturebox, I've tried the following: picturebox1.image = imagelist1.index????? I don't know the syntax, how do I choose a picture from an imagelist and place it into a picturebox. Thanks :)

Member Avatar for LizR
0
116
Member Avatar for mrrko

[code=cpp]#include<iostream> using namespace std; int computeDifference(int hours_par, int minutes_par, char isAM_par, int hours2_par, int minutes2_par, char isAM2_par); //Precondition: Hours and minutes are input from the keyboard, hours must be in a 12- hour notation, // between 1 and 12. Minutes should be between 0 and 59. isAM must be either …

Member Avatar for Lerner
0
89
Member Avatar for mikeregas

This program is suppose to be a spell checking program and I just can not get it to work can someone please take a look and let me know what I need to do to fix it [code]#include <stdio.h> #include <string.h> #include <stdlib.h> //CONSTANTS #define wrdlen [48] #define linelen [1024] …

Member Avatar for ArkM
0
175
Member Avatar for DJPlayer

problem is a little harder than I expected maybe b/c of the specifications of the problem. Help would be appreciated because I've turned this into a mess. Input is a command line argument representing int between 0 and 255 Output: convert string to binary and output as array of numbers …

Member Avatar for cikara21
0
157
Member Avatar for faisaly

Considering the given code as an algorithm calculate the time complexity of this code. #include<iostream> #include<stdlib.h> using namespace std; int main(){ int i, j, n; for(i=0;i<n; i++){ for(j=0; j<n; j++){ cout<<"my time complexity is = "<<i*j<<endl; } cout<<"complexity is increasing"<<j<<endl; } system("pause"); return 0; }

Member Avatar for Freaky_Chris
0
136
Member Avatar for n_borad

Please help me with this program Your assignment is to write an assembler program which does the following: (1) prints your name and NYIT I.D. as a first action. (2) reads in two 2-digit integers, one keystroke at a time, and operates Euclid’s algorithm on them (3) prints the result …

Member Avatar for n_borad
0
126
Member Avatar for emilio

hi. i'm trying to write a reversi game with a smart computer player. i want to use an alpha beta pruning minimax algorithm. i wrote the code but the computer is not smart. can somebody help me with my code ? [CODE=java]public int[] Play(String s,GameBoard gb,Color c) { int alpha …

0
61
Member Avatar for shankhs

I am trying to solve a typical 0/1 knapsack problem (using greedy algorithm). In this problem I have to sort a structure consisting of 2 ints (one that contains the value and their corresponding amount I have to minimize the value to get `n' amounts so i need to sort) …

Member Avatar for ArkM
0
164
Member Avatar for chunalt787

I am currently learning about heaps and specifically their relevance to priority queues. I don't seem to understand a couple concepts and was hoping someone could clear these up. First of all I don't understand the remove function. I get that it replaces the root with the last external node …

Member Avatar for shrughes
0
87
Member Avatar for kaisoze

Probley a really simple one ive got the basis of the Dijkstra’s algorithm [CODE] # findRoute - dijkstra's algorithm. # def findRoute(source, dest): global theGraph theGraph.reset(source) while theGraph.get () != []: u = theGraph.getBestChoice(source) theGraph.addVisited(u) if u == dest: return True for v in theGraph.getNode(u).getNeighbours(): theGraph.addChoice(v) alt = theGraph.getNode(u).getDistanceFrom(source) + …

Member Avatar for jlm699
0
117
Member Avatar for sAeNxNyA

anyone have any iddea of how to do booth algorithm using tasm to add multiply 2, 32 bit and store it in a 64 bit register

0
37
Member Avatar for mrtwinkles

Im trying to make an annogram. first you input a word, and then it mixes it up and then couts the scrambled version of the word. My problem right now is that when you input a word like "Cat", it will mix up and look like "aCt" or something with …

Member Avatar for DemonGal711
0
218
Member Avatar for soultrav

I am building an xml parser in java which will handle a catalog with some books (that have price and usefulness) and I want to implement an [B]optimum[/B] algorithm that selects the books from the catalog which have the maximum usefulness while staying within the budget. Example: [code] <catalog cash=”100”> …

Member Avatar for dickersonka
0
102
Member Avatar for coolbuddy059

I'm writing a code for all the algorithm mention in cormen there are term DISK-READ and DISK-WRITE. Actually what the author want to say by using these terms.

Member Avatar for ArkM
0
143
Member Avatar for bahr_alhalak

hi every one... i need some help from u.. i solved my assingment by my self an I need from u some help I will post my prgram and please check it if it need any edite or anything... This is the mainClass [CODE]import java.util.*; public class mainClass { public …

Member Avatar for dickersonka
0
115
Member Avatar for kyserthehun

Hi, i'm having a little trouble with my Zeller's Algorithm problem. Everything seems to work fine unless the year is 1600, 1700, 1800, ect. I've been trying to figure out where i went wrong but to no avail. I'd appreciate any advice. Thanks. [code] #include <iostream> #include <iomanip> using namespace …

Member Avatar for ddanbe
0
789
Member Avatar for mrboolf

Hi all. I am playing around with [URL="http://www.gnu.org/software/libc/manual/html_node/Reading_002fClosing-Directory.html#Reading_002fClosing-Directory"]this[/URL] and [URL="http://www.daniweb.com/code/snippet579.html"]this[/URL] code snippet by Ancient Dragon. I didn't want to copy-paste so I came out with various simple attempts, the last of which looks like this: [CODE=C++]#include <iostream> #include <unistd.h> #include <dirent.h> #include <vector> #include <algorithm> using namespace std; int main(int …

Member Avatar for mrboolf
0
126
Member Avatar for sidatra79

Hi to all game programmers :icon_cool: I want to implement the following: Short description: [B]A* Star for partitioned space combined with an adaptive partitioning in 3D.[/B] Detailed description: A. Assume that in the 3D space I have an Object (myMovingObject) that I want to it to move from one initial …

Member Avatar for MattEvans
0
212
Member Avatar for Alex Edwards

This makes me slightly curious... Why is there assembly code for the string class of C++? [code=asm] page ,132 title strlen - return the length of a null-terminated string ;*** ;strlen.asm - contains strlen() routine ; ; Copyright (c) Microsoft Corporation. All rights reserved. ; ;Purpose: ; strlen returns the …

Member Avatar for ddanbe
0
1K
Member Avatar for bahr_alhalak

hello again every body ... [COLOR="Red"]i tried 2solveit ,but there are some problem faced me .. and i'll insert what i did .>>> This is the main class..the main problem in it how 2 print the array like the example which i show it 2 u ...[/COLOR] [CODE]import java.awt.DisplayMode; import …

Member Avatar for dickersonka
-1
212
Member Avatar for scapu

1. Hand simiulate the sequential search algorithm on the data set given below and the search elements being 10, 05, 76, 85, 200 Data set:: 10, 80, 03, 09, 55, 32, 100, 07, 05, 02, 12, 65, 63, 22, 92, 81, 48, 76 2. Design a conventional iterative algorithm 3. …

0
48
Member Avatar for ming97

Dear All I knew that te formula of time optimal and cost optimal of prefix algorithm is p=teta(n/log n). But I have information that it is the same with n=omega(p log p). I have some question : 1. is information true? 2. How about derive p=teta( n log n) to …

0
61
Member Avatar for lordx78

I doing a project about Genetic Algorithm (GA). I'm looking for some book that shows GA in Java. Please advise. [COLOR="Green"]Books[/COLOR] [COLOR="Red"]Websites[/COLOR] [COLOR="Green"]Journals[/COLOR] [COLOR="Red"]White Papers/ Publications[/COLOR]

Member Avatar for dickersonka
0
132
Member Avatar for s0ren

Hello Friends, I am trying to implement the Recurrent Reinforcement Learning algorithm found in [URL="http://www.klab.caltech.edu/refweb/paper/425.pdf"]this paper[/URL] I am hoping that someone here can help me develop at least a pseudo code version of the algorithm. I plan to implement the final version in C#. This is for a school project …

Member Avatar for ahyeek
0
281
Member Avatar for Dave Sinkula

What am I missing here? [CODE]#include <iostream> using std::cout; #include <vector> using std::vector; #include <string> using std::string; #include <algorithm> using std::copy; using std::remove; #include <iterator> using std::ostream_iterator; #include <utility> using std::pair; vector<string>& descend(const char *path, const char *pattern, vector<string> &filelist); void search(const char *path, const char *pattern, vector<string> &filelist); [COLOR="Red"]std::ostream& …

Member Avatar for Dave Sinkula
0
1K
Member Avatar for kidd218

This is about the arrays...I thought a lot...but I couldn't get any ideas from that...please help me.. thanks!! the question: A series of numbers can be read from the keyboard and put into an array of integers. You will then need to call a function to invert the values (1/x) …

Member Avatar for Aia
0
125

The End.