3,815 Topics
![]() | |
![]() | This is starting to drive me nuts. I'm writing a program that simulates a two-pass algorithm which translates assembly language code in C++. I started with the first pass which reads the labels and address for each line. My whole program is in a mess and need a lot of … |
hi everyone. i need to find all possible paths for directed graph with dynamic programming. let me clarify. i have a path from 1 to n and this is a straight line. every line has a value. i need a way where the cost is smallest. i take inputs as … | |
hi all! i have been programming in C for about 4 months now, and i have the very basics down pretty well (functions, pointers, etc etc), and have been doing a lot of console apps, and i was hoping to do a fractals program. i have the algorithm down (at … | |
Hi, I am trying to implement the K Means Clustering Algorithm for Image Segmentation. The logic behind K Means is : 1. Place K points into the space represented by the objects that are being clustered. These points represent initial group centroids. 2. Assign each object to the group that … | |
I am writing a hash algorithm simulator, I am running the keys through the hash but I am not being able to display the whole hash table after all keys are entered. I also I can not figure a way to check if there is any collision because I am … | |
My teacher gives a review sheet which is a lot like the exam if not the exam but with some minor changes. I'm stuck with these fill in the blanks. [CODE]Fill-In-The-Blank Word Frequency The following program gets the name of a file as a command-line argument, opens that file, reads … | |
Hi I need help;; Write a program to simulate a demand paging system. The program should implement the FIFO and LRU page replacement algorithms presented in Chapter 10 of the textbook. Your program input should include: The name of the page replacement algorithm. Information about the number of physical page … | |
I need to write a program that uses P = (nRT)/V P = pressure V = volume n = number of moles R= universal gas constant (8.31 j/mol K) T = absolute temperatre All variables must be local, no global variables. Inputs to the program include kelving temp, initial and … | |
Hello to you all , I am required to write a program which gets a Math Expression (without checking it is good) and put in Stack only the Brackets . Implementation of Stack is One-Way Linked List Only. Examples for Good/Bad Expressions : (a*{b+c}-4/x +[e-5]) - GOOD (5+} - BAD … | |
Hi There, Can you tell me how to check the updated algorithm of Google. How to update our site according to Google algorithm. Thank you | |
I keep receiving the same output for each record when I run it on the test data. I've tried numerous things...any suggestions? I've worked on this for almost twelve hours straight, not counting previous work. I'm hoping one of you guys/gals who know whats going on can point me in … | |
I need help writing a pseudo code for converting decimal to binary. this is for Python. I have the program but i am not sure how to write the code please help! thanks! | |
I had to develop a brute force, a recursive, divide and conquer, and transform and conquer algorithms for calculating the nth power of a, a^n, for an assignment. I got the first three done pretty easy but I'm completely stumped at how to do the transform and conquer algorithm. I've … | |
Can anybody tell me what is the difference between those 2 algorithms ? I've done a few research and it says Damerau-levenshtein enables transportation characters which levenshtein does not support. I wanna know how it does. Damerau algorithm on wikipedia isn't very clear. Please somebody point me to a good … | |
hi frndz.... i was wondering that given 1<n<1000000 & 1<r<1000000 how do i [B][I]efficiently[/I][/B] find nCr (combination) for any given values of n & r. please help with an efficient algorithm... | |
can anyone help me determine it? from the looks of pages on google. it's just a bunch of 90 degree angles that are constantly rotated 45 degrees about it's axis. thanks. | |
So I have to make a greedy algorithm to find the fewest number of coins needed to make change for any n cents. I have an infinite number of quarters(25 cents), dimes (10 cents), nickles (5 cents), and pennies (1 cent). This is the algorithm I came up with, it … | |
Hey Guys and Gals,I'm writing a program to find the highest and lowest of 5 integers.I think i have the algorithm almost right but it doesn't work.I think its something simple.......as usual......... [CODE] include <iostream.h> include <conio.h> int main () { double total=0,num1,num2,num3,num4,num5,high,low; cout<<please enter number; cin>>num1; cout<<please enter number; … | |
I am taking entry level C++ course, and I am having trouble with my assignment for this week on Sequential Files. Here is my assignment: Create a C++ console application that analyzes the contents of a text file. Your program should count the number of: lines (hint: use getline) words … | |
can someone help me do this problem An array can be used to store large integers one digit at a time. For example, the integer 1234 could be stored in the array a by setting a[0] to 1, a[1] to 2, a[2] to 3, and a[3] to 4. However, for … | |
Note:- I am NOT asking you to write the program for me. I am NOT asking you to do the homework for me either. All I am asking you is if you could suggest an algorithm for me. Present below are two algorithms. Can you please suggest me an algorithm … | |
i have array on 3*3 2D and every row are sorted and every colomn are sorted also and need to apply binary search on it as best algorithm e.g : 9 11 17 12 15 22 19 20 29 | |
Hey, I'm in a class in which the assignment here is to sort integers. We were called on to use two different sorting methods: InsertSort and HeapSort. My InsertSort works just fine. My HeapSort, however, does not; when the HeapSort() function is finished, the integers are still out of order. … | |
Hello all, I am trying to write a clustering algorithm where, given location of certain points (I.e, latitude and longitude) I need to choose 50 of these to be cluster centers such that the diameter of each cluster is minimized. To that end, I believe that the program should choose … | |
Any ideas on how would I be able to traverse this BTree in asceding order? right now I am sorting the data and giving it to my retreival() function to look for the keys. But naturally it visits and prints the data in ascending order because I give it sorted … | |
Hello! I had a question about appending data in to a file. My program flows in the following way-- [CODE] // This function reads data from the file parse_input_data_for_one_algo(some parameters) { FILE *f = fopen (filename, "rw+"); while ( fgets (in_line, 100, f) != NULL ) { //read values } … | |
[I]<<thread split from [URL="http://www.daniweb.com/forums/thread13488-9.html"]here[/URL]>>[/I] hi. i can c ur proficiency in the algorithm n complexity field. can u pls help me out? i need 2 understand it 4m the very beginin. take me as a layman n thn send ur replies. | |
[CODE]#include <iostream> #include <ctime> #include <cstdlib> #include <string> #include <vector> #include <fstream> #include <algorithm> using namespace std; class letter{ private: int genre; int price; string adress; public: letter(); ~letter(); }; class parcel{ private: int genre; int price; string adress; public: parcel(); ~parcel(); }; class post{ private: letter** LETTERS; parcel** PARCELS; … | |
Hello all!! I've been working on this code for a while now and I'm still lost. Can anyone tell me what's wrong with this code please??? I know Line 44 is missing something but I'm not sure what goes there, here is the pseudocode as well: /* pseudocode for Binomial … | |
Hi! I'm trying to implement an optimization idea for Dijkstra's algorithm for homework. This is the optimization idea that they want us to implement: [INDENT][B]Idea 3. [/B]Many of the vertices have exactly two neighbors. If a vertex [I]v[/I] has exactly two neighbors [I]u[/I] and [I]w[/I], then you can replace the … | |
hi everyone im my computer science degree am doing a module on algorithms tho we are studying it i am bit behind my question is what does n - 1 mean (n minus 1) what does n/2 mean (n over 2 or n divided by 2) because stuff like this … | |
I'm working on a Floyd's Algorithm type Java program. What I have done so far is represent a directed graph in a 2d array, and I am trying to transform that into a 2d array representing the graph's paths of length 2. I planned for it to fill the adj2[][] … | |
Required to use PriorityQueue to implements Dijkstra’s algorithm for solving the single-source shortest-path problem for weighted graphs without negative edge weights. I have a wrong output of my program. Here's the code: [CODE] //Graph.h class Graph { public: Graph(int r = 1, int c = 1); // constructor void setCost(int … | |
Hi Would any one tell me how can I generate a random permutation of N numbers in c++? Is there any algorithm in STL for this purpose? Thanks in advance | |
I am trying to run a source code that I downloaded. However, there are several error message in reference to the classes TablePanel, BufferedPanel, Stringable, and Booleanview. I am not sure why I am getting these errors because it is a complete source code. Do I need to import additional … | |
![]() | Hey everyone. I'm getting REALLY frustrated with this program and I've been working on this problem for too long now. I am building an undirected and unweighted bi-connected graph class which detects all the articulation points. I am able to detect all the articulation points but I cannot figure out … |
I'm working on a project implementing Dijkstra's Algorithm. The project involves reading from an input file and the format of the file is as follows: - The first line of the file tells the number of total vertices and the number of edges (n, m) respectively. - The rest of … | |
Hey you guys i have a major problem here basically im a begginer c++ program student and i am trying to get use to vectors and functions so i made this program like a mad lib game or a bear hunt as you say. The program basically have vectors (duh) … | |
I have an exam coming up on this unit found in the guide to programming with Java textbook. I was just wondering if someone can provide an algorithm to the following question. 13. a.) Write an algorithm to count the number of words in a sentence. b.) Write an algorithm … | |
Hello guys! I have an assignment in my data structure class and I want to ask following thing: I have txt file which is unordered (not sorted) say like this: red apple blue sky white car handsome boy hello world My program should read file into linked list and sort … | |
hi this program starts off with random letters, then using a genetic algorithm eventually forms the "hello world!" basically i need this code to be able to input a word of the users choice, everytime i try something i get an error of some sort thanks [CODE]#pragma warning(disable:4786) // disable … | |
Hello everyone, I been reading a bit about Levenshtein distance algorithm (edit distance) from [url]http://www.merriampark.com/ld.htm[/url] site. I'm pretty clear with how the algorithm works but I've no idea how to edit ( edit here as in edit , delete, insert a word or words) after i've gotten the distance. Can … | |
Can someone help me figure out why nothing comes up on the output screen. The program compiles but the the output is blank. 1. Maintain information on all students. Each student has the following: 1st line - lastname, city of residence, student id, ssn 2nd line - course, course id, … | |
Hello :) This is my first post on daniweb forum and I hope this site will help me improve. I'm a first year college student in computer science, and I've only recently started C++. This means that code posted by me might seem very lousy and /or unprofessional. I have … | |
I'm having difficulties thinking through the logic of my natural mergesort program. I think I have the split working correctly, but my merge doesn't seem to be working at all, and the pseudocode in my book and what I've found so far on the web is fuzzy. This is a … | |
Hello guys, I've got a question related to my data structures class. I have file in which data is unordered. Say: hello apple blue phone number I have to search a string using Binary Search. But since we cannot apply Binary Search to unordered list, we should make an ordered … | |
[code]/****************************************************/ /* File: Binomial Numbers.cpp */ /* */ /* Created by: Regine R Calinda */ /* Date: November 9, 2009 */ /* */ /* Program to compute binomial coefficients */ /* */ /* Inputs: (keyboard) */ /* Two positive integers (n & k) */ /* */ /* Output: */ /* … | |
Logic Used: Insert Pixel Data into a struct containing RGB values of the pixels read Data in a 3x3 array: | BGR(-1,-1) | BGR(-1,0) | BGR(-1,1) | | BGR(0,-1) | BGR(0,0) | BGR(0,1) | | BGR(1,-1) | BGR(1,0) | BGR(1,1) | Assign Average of all Blue,Green,Red components respectively to another … | |
I have this program that is supposed to read part numbers from a text file. 101-110, 301-310, 501-510 and put them into a hash table. It will prompt for one of four algorithms to be used and then continue to load the part numbers. Everything seems to be working okay, … | |
I need a java code or algorithm for converting eNFAs to NFAs. This is our project for our automata theory class and our prof said that it would be alright to get codes from other people as long as we fully understood how the program works. Please help me and … |
The End.