3,815 Topics
![]() | |
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 * … | |
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? … | |
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 … | |
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]; … | |
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 … | |
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 … | |
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 … | |
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 <= … | |
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 … | |
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. … | |
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. … | |
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 … | |
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 … | |
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> … | |
![]() | 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 … |
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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
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, … | |
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 … | |
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 :) | |
[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 … | |
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] … | |
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 … | |
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; } | |
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 … | |
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 … | |
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) … | |
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 … | |
![]() | 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) + … |
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 | |
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 … | |
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”> … | |
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. | |
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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
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. … | |
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 … | |
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] | |
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 … | |
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& … | |
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) … |
The End.