3,815 Topics

Member Avatar for
Member Avatar for jmcorpse

This is what I have to do. Write a program that has a Fibonacci number calculating function. The function will take an integer as a parameter which is the Fibonacci number to calculate, and return the Fibonacci number. Then use this function to calculate the sum of every Fibonacci number …

Member Avatar for jmcorpse
0
104
Member Avatar for Ogakor

Hello, I've been having problem with understanding merge sort for linked list. I understood merge sort for array though, I think. I've googled it and all I can find are codes. I need to understand the algorithm first before I can understand the code. Please help me understand merge sort …

Member Avatar for Martin B
0
199
Member Avatar for shasha821110

Hi, all I have questions about the google sitelinks. I know Google sitelinks is completely automatically generate for the website and it depend on the Google. but how could i change my site structure to make the google algorithm find my links? if i create some specify subdomains or directory, …

Member Avatar for rahulbatra
0
315
Member Avatar for jeffcogswell

[ATTACH=RIGHT]17677[/ATTACH]Here at DaniWeb, we've talked a lot about [URL="http://www.daniweb.com/reviews/review313227.html"]Intel Parallel Studio[/URL]. I recently had the chance to sit down with Intel's James Reinders, and find out more about his take on [URL="http://software.intel.com/en-us/intel-parallel-studio-home/"]Parallel Studio 2011[/URL]. Mr. Reinders (pronounced Rhine-ders) is a senior engineer at Intel and has been with the company …

7
773
Member Avatar for mtmalleus

Hey guys. I'm new to Python. I kinda blundered into a CIS major at the university I attend, and I have to say, I haven't enjoyed the Python class so far. It's so... esoteric. I'm having a TON of trouble grasping what the rest of my class view as simple …

Member Avatar for Schol-R-LEA
0
185
Member Avatar for Fbody

I am trying to sort a vector that is a [B]protected[/B] member of a templated class into a Descending order based on the [I]second[/I] member of the contained std::pair objects. The vector has the following declaration:[CODE]vector< pair <const T, int> > mode; //holds pairs to define the mode(s) of the …

Member Avatar for Fbody
0
3K
Member Avatar for iwanttolearnc

the problem is that of a path planning algorithm. the obstacles will be rectangular shaped boxes. what i need to do is detect the rectangular boxes, and then add a black "aura" around these boxes. any ideas on how i go about doing this?

Member Avatar for woooee
0
99
Member Avatar for stevanity

Guyz please help me Ive got a practical exam tomorrow can anyone give a simple coding for implementing prims algorithm. It accepts the vertices and cost and gives out minimum spanning tree. Please guyz. It must be very simple. It need not be perfect. It need not work for all …

Member Avatar for Adak
0
689
Member Avatar for stevanity

Can anyone explain this code used to implement prims algorithm to find min spanning tree [CODE] #include <iostream> using namespace std; int g[20][20],visited[20],d[20],p[20]; int v,e; void creategraph() { int i,j,a,b,w; cout<<"\nVertices: "; cin>>v; cout<<"\nEdges "; cin>>e; for(i=1;i<=v;i++) for(j=1;j<=v;j++) g[i][j]=0; for(i=1;i<=v;i++) { p[i]=visited[i]=0; d[i]=32767; } for(j=1;j<=e;j++) { cout<<"\nEnter (a,b) and cost\n"; …

0
54
Member Avatar for rizla777

hey im just having a bit of a problem on reading input from a text file. I know that it is probably something simple but I keep overthinking it. Here is what I am trying to do: I'm trying to read in a line of text that contains musical notes. …

Member Avatar for new_programmer
0
149
Member Avatar for old_jefrey

Hi there, Let's say we have the following: [code] #include <map> #include <string> #include <vector> #include <algorithm> using namespace std; typedef pair<string, int> Data; class DataCompare { public: bool operator()(const Data& el1, const Data& el2) const { return lessK(el1.first, el2.first); } bool operator() (const Data& el1, const Data::first_type& k) const …

Member Avatar for old_jefrey
0
107
Member Avatar for flyingcurry

The program is supposed to find all the combinations of the letters in "computer", the algorithm was given to me, but I don't have any idea of how it dos its work, all I get from this is a an infinite amount of "nullp" Here is the code: [CODE] public …

0
93
Member Avatar for endsamsara

Hi, well I need to do a program in Java that shows the solution of the famous game 8 puzzle (the object of the game is to place the tiles in their place with the less possible movements) So using the class Astar Given by our teacher we are asked …

Member Avatar for Weixing
-1
5K
Member Avatar for gavin2010

here is the assignment....im suppost to write 4 functions which are : [code]bool operator==(const T) const; bool operator< (const Frequency) const; template<typename T> vector<Frequency<T> > Distribution(const vector<T>& v); template<typename T> ostream& operator<<(ostream& out, const vector<Frequency<T> >& v);[/code] my code is at the very bottom Write a template function that will …

0
53
Member Avatar for gaurav_13191

This is my code for drawing a circle using mid point algorithm:- [CODE] //Midpoint circle algorithm #include<graphics.h> #include<stdio.h> #include<conio.h> void drawcircle(int xc,int yc,int r); int main() { int gdriver=DETECT,gmode; initgraph(&gdriver,&gmode,"..//bgi"); drawcircle(250,250,10); getch(); return 0; } void drawcircle(int xc,int yc,int r) { int p,x=0,y=r,incr1=2*x+3,incr2=incr1+2-2*y; void drawPixel(int,int,int,int); drawPixel(xc,yc,x,y); p=1-r; while(x<=y) { if(p<0) …

Member Avatar for Adak
0
134
Member Avatar for Yutxz

Why is my while statement being ignored? [B]Problem:[/B] Write a method called squareRoot that takes a double as a parameter and that returns an approximation of the square root of the parameter, using this algorithm. You may not use the built-in method Math.sqrt. As your initial guess, you should use …

Member Avatar for masijade
0
260
Member Avatar for Akulki
Member Avatar for Kontained

Hi all, I'm currently working on a RC4 project for my computer security class. I have looked at the [URL="http://en.wikipedia.org/wiki/RC4"]wikipedia page[/URL] for RC4, and I'm trying to adapt that algorithm to my problem. I can get the correct encrypted text when I just cout the values. However, when I try …

Member Avatar for Kontained
0
3K
Member Avatar for NordCoder

Hi Daniweb, I doing an assignment for a course I'm taking at my university. The assignment involves using the Boost Graph Library (version 1.43). So far, I haven't had any trouble at all. Then I tried calling dijkstra_shortest_paths(...). The named parameters way of calling this function does not work in …

0
75
Member Avatar for stereomatching

I am using the library of boost to create a 2D dimensions array and compare about their speed There are three kinds of array, matrix of boost, multi_array of boost and the raw array Below is my code: [code] #ifndef TESTRELMAT_H #define TESTRELMAT_H #define BOOST_NO_EXCEPTIONS #define BOOST_DISABLE_ASSERTS #include <boost/numeric/ublas/matrix.hpp> #include …

Member Avatar for Narue
0
141
Member Avatar for hq1

Hi I'm tryingt to write this program: Write an interactive computer program that will find the greatest common divisor of two integers using Euclid's Algorithm. The program should be independent of the order in which the two numbers are input. EUCLID'S ALGORITHM Divide the smaller number into the larger. If …

Member Avatar for Unimportant
0
114
Member Avatar for power_computer

Hello all, I am given a project and would like some help/guidance from the community. I am not asking for any code just a direction and little advice on how to approach this project or how these things work per-say. I am behind in my classes due to me having …

Member Avatar for VernonDozier
0
1K
Member Avatar for jtxay

Okay well i'm having trouble understanding this program ..in which our professor doesn't even explain..I'm so lost.. I hope somebody can help me please.. here's the problem... I have to write a program in c++ that computes the number of days between two dates using the Julian day number which …

Member Avatar for Akill10
0
263
Member Avatar for sijothomas

Hi friends ...... I am doing a priject based on face recognation in java .... If anybody knows about it please help me....my doubts are:- 1-how can i read inage from a web cam ? 2-give a best and latest algorithm for comparingtwo images Anyway thanks in advance...May GOD bless …

Member Avatar for cale.macdonald
0
72
Member Avatar for cool girl

I have so much trouble with this questions not only questions I want to study big o and time complexity but until now I didn’t found any good sit that explained it so could anyone help me by proved some sits about big o and time complexity and I really …

Member Avatar for kramerd
-1
158
Member Avatar for peter26

I've gotten this question for an assignment in our introduction to computer science. And I have absolutely no idea on how to solve it. Help very much appreciated!! This may sound like a cliché, but my girlfriend just left me, so I can't think straight even though how hard I …

Member Avatar for Momerath
0
99
Member Avatar for G-Do

Here's something of mine that might actually be useful: a Python implementation of the K-means clustering algorithm. I wrote something similar last year in Java for a school project, and decided to rewrite it in Python this summer for practice. The purpose of the algorithm is to discover internal structure …

Member Avatar for woooee
2
1K
Member Avatar for gaurav_13191

I have the following code for DDA Line Algorithm in C :- [CODE] //DDA Line Algorithm #include<stdio.h> #include<graphics.h> #include<conio.h> #include<math.h> #include<stdlib.h> #define Round(a) ((int)(a+0.5)) void linDDA(int xa,int ya,int xb,int yb); int main() { int gdriver=DETECT,gmode; initgraph(&gdriver,&gmode,"E:\\TC\\bgi"); linDDA(10,20,200,100); clrscr(); getch(); return 0; } void linDDA(int xa,int ya,int xb,int yb) { int …

Member Avatar for gaurav_13191
0
108
Member Avatar for Techwriter10

When I researched an article on multimedia search last year for [URL="http://www.econtentmag.com"]EContent Magazine[/URL], (The [URL="ttp://www.streamingmedia.com/article.asp?id=9879"]resulting article[/URL] was republished on Streamingmedia.com last December.) I learned in the course of my research that it's hard to search for non-text elements because they lack the contextual language of text. Seems logical enough, but …

Member Avatar for gprsg
0
226
Member Avatar for Rahul.menon

[CODE] #include<stdio.h> #include<conio.h> void main() { int num[50],i,i1,j,temp = 1,cnt = 0; printf("How many elements "); scanf("%d",&i); printf("Enter the elements "); for(j = 0;j<i;j++) { scanf("%d",&num[j]); } i1 = 0; j=1; while(i1 < i ) { for( ;j<i;j++) { if((num[j] < num[i1])&& (i1<i)) { temp = num[j]; //algorithm for sel …

Member Avatar for Rahul.menon
0
94
Member Avatar for mitrious

The execise in the books asks this: Design and implement a program to produce a permuted index. A permuted index is one in which each phrase is indexed by every word in the phrase. And says: A good algorithm is suggested in The AWK Programming Language by Aho, Kernighan, and …

0
68
Member Avatar for flyingcurry

The task is to use a recursive algorithm to determine the sum of two numbers n1 and n2. I just keep on returning to using the formula n1*n1 +n2*n2 The part which I have questions is I don't get how to do this in a recursive way. Thanks!

Member Avatar for flyingcurry
0
2K
Member Avatar for it-lady

Analysis of algorithms is a form of mathematics. Consider the following problem: • We assume that a pair of squirrels has a pair of children every year. • These children are too young to have children of their own until two years later. • Squirrels never die. (The last assumption …

Member Avatar for it-lady
-1
100
Member Avatar for daffi_gusti

Hello all, Anyone knows how to create apriori algorithm using PHP? I would be apreciated if you give me a code. Thanks.

Member Avatar for chrishea
0
105
Member Avatar for jmcorpse

Hello, I had quite a few bugs with this program and it's fore-bearer. I got all but one of them fixed and it's in one of my if-else loops. When the program runs it runs good and then when it gets to the loop it only pulls out the first …

Member Avatar for jonsca
0
139
Member Avatar for dustfingers

I am trying to implement a map for a aerial combat game, that could be reused for AI portions as well...... but I am a bit confused about the map representation of a 3D scene..... Should I use simple node styled graph? Or a navigation map, though I don't see …

0
43
Member Avatar for aro_kai

i am trying to implement an AI part for the FPS type of game ...heard it is called Aerial Combat game...... my basic idea for the AI portion is that I an going to have two Finite State Machines running simultaneously, one for locomotion or movement decision and another for …

0
66
Member Avatar for selle05

can someone help me in creating a program that will simulate the two page replacement algorithms by using a reference pattern or string. The output of the program is to give the number of page faults of the two algorithms. Details of the program: 1. Declare a one dimensional integer …

0
56
Member Avatar for mrnutty

Just for Fun, and for reference to the web searchers, lets start a series of problems in computer science thats ranges in difficulty from [1,10], where 1 is easy, and 10 is harder. Maybe I and others will learn something useful from this. The following exercise is meant as an …

Member Avatar for csurfer
0
125
Member Avatar for purijatin

Hello! Can someone please suggest a way to effectively copy the bytes from one array to another. In my program a user will call the method setDate(byte[] buf) which will set data continuously ie inside the method there is an array say buf2. for example if the method is called …

Member Avatar for purijatin
0
5K
Member Avatar for mitrious

I "miss wrote" the name of the book ... sorry ahhaha accelerated hhahah why did I write advanced ... damn =S ahha 4-2. Write a program to calculate the squares of int values up to 100. The program should write two columns: The first lists the value; the second contains …

Member Avatar for daviddoria
0
149
Member Avatar for yakovm

Hello Given a DAG with [TEX]$|V| = n$[/TEX] and has [TEX]$s$[/TEX] sources, we have to present subgraphs such that each subgraph has approximately [TEX]$k_1=\sqrt{s}$[/TEX] sources and approximately [TEX]$k_2=\sqrt{n}$[/TEX] nodes. (Note: **Approximately** means that each subgraph contains[TEX] \lceil \sqrt{n}\rceil[/TEX] or [TEX] \lfloor \sqrt{n} \rfloor[/TEX] nodes and covers [TEX] \lceil \sqrt{s}\rceil[/TEX] or …

0
66
Member Avatar for Ptap03

Hello, I'm new to this thread but have referenced to it before many times. I have finally joined thanks to all the great responses I have read in the past. Okay, I recieved an assignment which is as follow... "Declare a dynamic array of Person to store the information of …

Member Avatar for VernonDozier
0
461
Member Avatar for myk45

Hello, im trying to write a recursive algorithm to generate the following binary sequence. ie basically: for 3: 000 001 010 011 100 101 110 111 i tried the iterative method, it works fine. this is what i did: [CODE]for (i = 0 to pow(2, n) ) { //generate the …

Member Avatar for mrnutty
0
1K
Member Avatar for starpointer123

I'm currently working on a recursive descent interpreter using C++. Though there is already a code on the project, I'm asked to rewrite the Recursive Descent Interpreter implementing it using a list class without using templates and facilites from the standard template library. I already worked through part of the …

Member Avatar for starpointer123
0
188
Member Avatar for XodoX

I'm trying to code a sentence editor. So, basically the input comes form a file, and the code sorts the words. The input in the file is I not do know, theoutput is I do not know. This is what's gonna be in the input file, but it can be …

Member Avatar for XodoX
0
168
Member Avatar for fandango

I have a struct "Telegram" which contains a time offset, the Sender ID, the Receiver ID, and the Message itself: [CODE]struct Telegram { int Msg; // Message unsigned long Time; // Time offset (i.e., GetTicks() etc.) int Sender; // ID of Sender int Receiver; // ID of Receiver Telegram(int tMsg, …

Member Avatar for fandango
0
203
Member Avatar for BlakTasTic

I am taking an algorithm class and haven't coded in c in around 5 years and realized I have forgotten alot. I tried to use atoi, i know there is a better function but for what I'm using it for and my lack of knowledge now it is simpler, for …

Member Avatar for WaltP
0
103
Member Avatar for lradske

i have made a program with a vector that is a instance of a class student with three variables. i have stored the information and calculated the class average. what I want to do is get the person with the highest test score and output "this student has the highest …

Member Avatar for Ancient Dragon
0
117
Member Avatar for it-lady

1. Suppose we have three functions f(n), g(n), and h(n) such that f(n) = O(h(n)) and g(n) = O(h(n)). Must it be the case that f(n) = O(g(n))? Explain why or give a counterexample showing why not. I think it is equal ! what you think ? 2. Write a …

-1
66

The End.