3,815 Topics
![]() | |
I have a dijkstra algorithm running and i would like to see it (next to the picture for which it is calculating). It would be cool if it can be done step by step: for the first step the block containing the used commands should have the color red; next … | |
Hello everyone! I am writing a music database, and I need to insert into album table the path to its cover. However, not every album has a cover in its directory, so I've made an algorithm that only gets the albumID that has a cover. My question is - how … | |
Greetings once more. I have been working on a script to convert a user provided number in basetwo and convert it to baseten. What I've got so far: [code=python] myinput = raw_input("Enter a binary real number: ") (myint, myfrac) = myinput.split(".") x = int(myint[0]) y = 0 t = len(myint) … | |
Hi, I'm trying to 'reduce' a vector using the erase algorithm within a for loop. The idea is to scan a table looking for equal successive elements. Once equal elements are found, it erases one of the 2 elements. I'm suspecting a problem in the for loop, due to the … | |
Hello everyone! I am writing a function to multiply two matricies together. I have written a simple algorithm for a matrix 3x3 - [CODE]void multiply() { int a[3][3], b[3][3], c[3][3], i, j , p, val = 0; a[0][0] = -1; a[0][1] = 0; a[0][2] = 1; a[1][0] = 5; a[1][1] … | |
Hi there, I'm becoming increasingly confused trying to implement an array of pointers, that themselves point to nodes in a linked list. Basically my problem is that I need to sort through an existing linked list per element, over all other elements (which works fine) based on a particular criterion, … | |
Hi I need help with this, 1) an algorithm or way to count the levels of an unbalance binary tree (e.g. root has one level 2) to balance this unbalance tree can I have some hints please! or examples greatly appreciated | |
Greetings everyone. This is my first post on this board, and I would like to offer thanks for any and all help, guidance, advice, and/or bonks on the head in advance. I am an aspiring programmer currently learning Python as a way to introduce myself to the world of software … | |
Hi guys I just trying to do some string matching and I want to use boyer-moor algorithm. What I am doing is, read a file from fopen() and searching counting the word "table" in the file.Can any one let me know a palce where a php implementation of boyer-moor algorithm … | |
I have searched for a tab menu script for a long time but none of them was flexible enough,then i created one for me. The algorithm is nice so the script is not too long although being flexible. your tab menu is in an html table row as follows : … | |
Hi..i need to know how i can make test with time.. I have implemented genric dynamic array with sorting algorith descending ascending and also operator overloading so ineed to test every function + sorting algorithm and it is template i do not know how to do that plz...help... | |
[code] #pragma once #include <iostream> /* * Author: Makhdoom Shah 4872 * Date of creation:22/2-2008 * Date of revision: * Revesion #: 1 */ using namespace std; //typedef double itemType; // need for another type, change it here template<class T> class dynarray { public: dynarray( int s = 0 ); … | |
Hi all, Can anybody help me with a an algorithm to find the maximum subset sum in an array. It would be better if the solution is of O(n). [example: {5,-2,10,-4} the maximum is 5 + (-2) + 10 => 13]. | |
May I ask you for help, how can I compare the elements of an array. I have to use threads, but I don't know much about it. For every 2 elements I create a thread and it compares them. The thread writes 0 in the element that is smaller and … | |
Hi again; Today I've got some silly questions about the translation of an algorithm to c++ :S (hey matrimkar, I found something that should work!:idea: ) well, my questions are in comments in this code: You can just read the first 2 paragraphs of the code, the 3rd one is … | |
[CODE] [LIST=1] [*]void selectionsort(int numbers[],int arraysize) [*]{ int i,indes,large,j; [*] for(i=arraysize-1;i>0;i--) [*] { large=numbers[0]; [*] index=0; [*] for(j=1;j<=1;j++) [*] { if(numbers[j]>large) [*] { large=numbers[j]; [*] index=j; [*] } [*] } [*] numbers[index]=numbers[i]; [*] numbers[i]=large; [*] } [*]} [/LIST] [/CODE] i have been able to understand upto 7 line. can someone … | |
I know how to write a program for a multiple process scheduler using different algorithms but I wanna know how to implement the algorithm with 5 to 10 processors with different speeds and memory ( 256mb to 2gb). So far i know how to calculate the wait time with number … | |
Hi guys :) Well I have this project in which we have to build an application that tack the instructors names, the sections, the rooms, and the classes times to generate a schedule for the next semester. But am really new in this field and I have been searching for … | |
I have a homework assignment i Am totally confused on. I started with a basic code to determine if a number is prime or not, but need guidance from here. I will post assignment details then what I have so far. Problem 1: Is it a prime number? Write a … | |
hi people. i am doing my project on adaptive detection of design flaws, and i have been incorporating decision tree algorithm of c4.5...its that my project has to be submitted on a deadline of march 3 so guys plz help me out.. if you know any effective sites which posts … | |
Hello, Could you explain me why the first approach in the code above works and the second one fails? [CODE] #include <cstring> #include <algorithm> //char a[] = {'a', 'c', 'b', 'a', 'c', 'b', '\0'}; // Works char* a = "acbacb"; // Fails sort(a, a+strlen(a)); [/CODE] | |
Hello to everybody. I'm trying to solve an ACM task #755 called [URL="http://icpcres.ecs.baylor.edu/onlinejudge/index.php?option=com_onlinejudge&Itemid=8&category=9&page=show_problem&problem=696"]487-3279[/URL]. It's about telephone numbers, quite straightforward. But still something is wrong in my code, because the automatic control says "Wrong answer" and I can't find on which input it fails. I tested it on Windows using MinGw. … | |
hi..i am new progarmmer for c++ and i really need help coz i have lots of problom while doing progamming in c++. i need guidance how i can implement my code or if someone could start the code for so it might be easy to continue. i need everything in … | |
Hi, I'm new to assembler and I really need to make this work as it's crucial to my success in this course at college. Normally I wouldn't ask for help, but because time is such a factor now and due to my limited understanding of the language, I feel I … | |
I was asked this question in an interview. Am looking for answers for this: A rectangular array of cells (say m*n) are selected in a spreadsheet (eg: MS excel). Assume that the cells contain only integer values. They need to be pasted to some location within the same spreadsheet after … | |
help am a new programming student and i've got ploblem with my assignment and i need help on solving this problem. i have the question listed below for review. Coban LTD. is a loan granting facility. The company ran an advert in the national daily newspaper requesting interested applicants to … | |
The program is broken into two parts: the lexical analyzer and the syntax analyzer plus semantic. The lexical analyzer should recognize the token using DFA and return the token and the value. The syntax and semantic part can be done by using any algorithm that can check for the correct … | |
Hello , First i want to excuse for my bad english ... :( Now to the question ... I make a web - based strategy game ... I'm almost finish it But I have problems whit battel algorithm ... I just can`t do it ... My idea is this : … | |
I need help n writing a simulated annealing algorithm that is able to maximize f(x)=sin(0.15*x)+cos(x) defined on the interval 0<= x <= 40 using the cooling schedule. Please help me im supposed to generate random numbers between 0 and 40 and Substitute in f(x)=sin(0.15*x)+cos(x) then what should i do next....... … | |
What would be the best possible algorithm for finding out all the combinations a given string can be rearranged. It should even consider cases for repeated characters Any other strategy than brute force would be appreciated | |
I am a beginner and need help with my program in C. My assignment is to find all the prime number up to the number the user input using a sieve algorithm. for example if user input 6 , the prime numbers will be 2, 3, 5. Then it should … | |
Hi all, I added a new script to the code snippets page. This time, it's a logic puzzle called "Petals Around the Rose." The goal is for you to infer what algorithm is being used to "score" rolls of five colored dice without peeking at the code. The snippet is … | |
I Am Working On A Project Related To Data Compression Using Huffmann Algorithm In C Language..........i Have Generated The Huffmann Codes Using Huffmann Tree.........but The Project Is Yet To Be Completed As I Don`t Know How To Store The Codes In Bits.............i Have Just Learned C. We Have To Submit … | |
I have a problem in my programming ....kindly help me...how to implement this problem.... Make a Java application that will create and implement the following: Global data: static int[] num1 = new int[10]; static int[] num2 = new int[10]; static int[] num3 = new int[20]; Methods: //arrNo value is either … | |
hi people, I havent received any replies for the question i had putforth regarding the mini project adaptive detection of design flaws,and im glad to inform you all that i have proceeded with the project effectively and i have choosen "C4.5" algorithm (decision tree).i am also incorporating the machine learning … | |
-------------------------------------------------------------------------------- hi guys I'm a final year student, in engineering. i've just signed up to this forum. Hope all is good. i'd appreciate any help. I have a piece of matlab code which used to work like last year. but i am having some trouble with it now. Before i … | |
Implementation of Apriori algorithm using count distribution algorithm could any one send the source code at [email]chetan_a84@yahoo.com[/email] | |
How to correct the output, because for the bold it follows every studentid. [code=C++] /*------------------------------ Programming to coutn the examids ------------------------------*/ #include <iostream> #include <fstream> #include <string> #include <algorithm> #include <vector> using namespace std; struct student { string studentid; vector <int> examcode; }; int main () { int mycount; { … | |
input = integer n, array a[1..n] output = integer w, arrayb[1..w], array c[1..w] [code] w = 0 while (true){ k = 1; while (a[k] is equal to nil) do k++; if k equals n +1 then halt algorithm end while w++; b[w] = a[k]; c[w] = 1; a[k] = nil … | |
Introduction Almost every webmaster in any event deals with video content. Very often there is a need to cut or convert videos, make thumbnails, etc. So, I think it will be helpful to give the readers a brief description of the main functionalities that our products have. [URL="http://www.videocharge.com/"]Videocharge[/URL] Videocharge is … | |
Hello, I have base class and a derived class if I want to use bost::bind in an algorithm to call a virtual function that is declared in the base class I have two options: [CODE=C++] struct Base { virtual void Go(){}}; struct Derived:Base { virtual void Go(){}}; Derived d; // … | |
I am trying to use sort defined in algorithm in c++. I want to use it in vector string ( vector<string> vec) can we use it i vector string. here is my code [code=c++] #include<iostream> #include<string> #include<vector> #include<algorithm> using namespace std; int main() { vector<string> vec; vector<string> ::iterator it; string … | |
Hello, I need to calculate the shortest path between two points with the ability to circumvent obstacles. Description tasks: PLAYING field is a 10x10 matrix (a unit of measurement - Cell) The player is in a 5x5 cell. It needs to be moved to a cell 8x9, but in different … | |
I have shared pointers to an interface created through out the program. I also have a list of weak pointers to their implementations in order to call internal update function. The program works, but when I compile it I get warning C4180. The question is, how to get rid of … | |
Hi all! I've been searching the internet and various C++ books for quite some time now, and I appear to have reached a brick wall. As suggested in a given algorithm written by my professor, during input validation, if the stream goes into failure, I am to "reset cin" followed … | |
[code=java]public class Formal2{ String name; double longitude; double latitude; double distanceFrom; public double getLongitude(){ return longitude; } public void setLongitude(double longitude){ this.longitude = longitude; } public double getLatitude(){ return latitude; } public void setLatitude(double latitude){ this.latitude = latitude; } public String getName(){ return name; } public void setName(String name) { … | |
Hello(repost)- I am reposting because I didn't get the answer I needed. My teacher gave us this problem in a lab and I need help with it. Basically, he wants us to write an algorithm to count symbols. The user will provide anywhere between 3-10 symbols and then an initial … | |
Thanks for all the help and advice, I got everything working fine with sessions and what not. Now I am back asking for help writing some scripts if anyone is willing... I am unsure how to write the code, with the exception of the random md5 password which I found … | |
Hello- My teacher gave us this problem in a lab and I need help with it. Basically, he wants us to write an algorithm to count symbols. The user will provide anywhere between 3-10 symbols and then an initial number. For example: user: 01234567, initial number: 106 output: 107, 110, … |
The End.