3,815 Topics
![]() | |
Hi guys so I am making function for my graphs (adjacency matrices) to return number of connected components using breadth first search algorithm. It almost works properly. It returns proper value if number of components is equal to number of vertices, but if number of components is smaller than number … | |
just tell me will this sorting algorithm work out in linked list for(i=head;i!=null;i=i->next) for(j=i->next;j!=null;j=j->next) if(i->data>j->data) { temp=i->data; i->data=j->data; j->data=temp; } | |
Hello! I'm attempting to create a application that randomly generates strings and tags it on the end of http://youtube.com/watch?v=.... but the links it generates links to a non existant video. I noticed there are more capital letters in their URL's but that's the only difference I can see. Here is … | |
I have the following as an Stl algorithm/vector: MyClass <int> VecOfInts("A vector of integers"); VecOfInts.push_back(3) VecOfInts.push_back(2) VecOfInts.push_back(1) I was able to get the numbers to display with a for loop (i < VecOfInts <size; i++). Now my question is: how would I get "A Vector of integers", to display, irregardless … | |
Hi Everyone, Background: I have recently implemented the A* pathfinding algorithm in C# based on some pseudo code that I found. I need the algorithm to run as fast as possible and at present my code isn't quite cutting it. I understand that the heuristics used can have a big … | |
Please, I'd like to know the difference and the special uses for each one. If I want to use it for text file compression whose algorithm is as follows, which one is more efficient? Encoding Algorithm 1. Initialize the dictionary to contain all blocks of length one (D={a,b}). 2. Search … | |
Hey everyone, i need help with this program im doing for a class, now i havent used c++ in a while so thats why im considerably fresh in all this. any at all help would be greatly apprecietated. ALso i can NOT spell to save my life. the problem states … | |
Hi I am trying to make an java application to compress file and folders in .zip format.. i want to add additional functionality of adding password to a zip file,for this i want to use aes-256 algorithm but i am stuck with this,i can't figure it out. if i apply … | |
Google recently changed its search ranking algorithm, how do we in the internet marketing business cope with these changes. What steps can be taken to increase a website’s ranking as per the latest Google update? | |
Hi All I have an file upload form and i secured it pretty well...One tedious problem is double extention upload. suppose user have a file `image.png` This upload fine and is fully legit.Now suppose a malicious user upload a file like `image.php.png` This file can simiply be a php shell … | |
Hello everyone, I want to implement Kruskal algorithm for finding minimum spanning tree in Adjacency Matrix for my program. So I want to write method Graph& getMinSpanningTree() . I have 2 classes: class Graph { public: /* Adds an edge between given vertices. Third argument is a weight of an … | |
Ok this is the classic Towers of Hanoi question. Legend has it that in a temple in the Far East, priest are attempting to move a stack of disks from one peg to another. The initial stack had 64 disks threaded onto one peg and arranged from bottom to top … | |
I am creating a network bridge that connects two ethernet cards on the same machine. One of the cards is connected to the LAN and the other is connected to a network device. It looks something like this, [Click Here](http://i.stack.imgur.com/BcoQI.png) I am sniffing packets on both the interfaces and then … | |
![]() | what is an algorithm for a program that reads 4 integers (not in array) and print them without using loop |
Hey, I made a small program for the k-clusters algorithm. In the current state though, I'm unable to erase the position of the centers from the previous itterations. If I use paintComponent(g) my jPanel will move down to the right and I have no idea why. (as shown here: http://tinypic.com/r/2eba0j8/6 … | |
So, I have to find rhyming words. Basically I am getting a bunch of words and I need to compare which ones rhyme. So if I am given words like... friendl|y, luck|y, murk|y, rapidl|y luc|ky, mur|ky frien|dly, rapi|dly They can also rhyme with other words, so a word could appear … | |
Im currently a student having degree in Computer Science. I had learn Java, C language, SQL, asp.net, javascript and html. In my course structure, I had learn AI, algorithm analysis, database system, object-oriented programming practices and etc. Im interest in forensic things and I want my final year project is … | |
Hi, In the program below, in the cout statement I want to understand what the code in the (ptr –arr) is doing. I understand ptr is the result of the find algorithm but I don’t know what the –arr does. If you can explain that to me I would appreciate … | |
I have a little problem to solve .. i have a array with x, y, z co-ordinates in it as a tuple. I am trying to find the distance between each point and sorting the points according to the min distance. Can soemone help me with the algorithm ?? | |
I started programming courses 4 months ago and I can't solve this problem according to it's required order . I need your help as soon as possible and I think it is easy for you :D thank's in advanced :) a) Given an unsorted array of integers, your task is … | |
Hi, When i run my program below, i recieve this error: ***Debug assertion failed! Expression: BLOCK_TYPE_IS_VALID(pHead->nBlockUse)*** this exception occurs when returning from fitness function. #include <map> #include <algorithm> #include <vector> #include <fstream> #include<time.h> #include <math.h> using namespace std; #define generations 10000 #define popSize 120 // population size #define makeRandNumber ((double)rand()/RAND_MAX) … | |
Can any one please help me to optimize the sieve to find the primes upto 10^8 ? I want very efficient algorithm to find all primes till 10^8 for cryptsystem. i have implemented the naive sieve which is taking too much time. please sgare some classic approach with me. i … | |
Hey everyone, We haven't done a good contest here on DaniWeb for quite some time, so I'd like to start one up again :) Throughout the months of June and July, I'd like to encourage members to submit fully working code snippets to our library. Throughout the month of August, … | |
as i m working on implementation of rsa algorithm,and during maiking console of it i found an error int cannot be dereferenced and i m unable to solve it because of working on java first tym...help me here is my code import java.lang.*; import java.math.*; import java.util.*; class rsa { … | |
Hi sir, I am student and I like to know about the algorithm for developing a MLM software for my final submision So, kindly tell me which algorithm works for the MLM software developement...need urgently please help.... | |
Derive an algorithm which updates the ith elements from the top of the stack, upgrade this algorithm to calculate the maximum value among the contents of the task. Hence write a java program to implement this task | |
This is not necesarily PHP, but algorithm question, I am just doing it in PHP. So don't know if its the best place to post. The problem is - I need to calculate maximum posible winning for a game, depending on bets. We are making dogs racing game, but the … | |
I need to implement public key deniable encryption, i want a simple algorithm. Any suggestions???/ Thanks | |
Hi All, I am a newbie of 8 weeks enjoying the challange of trying to understand java. I was assigned to create a rather challenging program in which the user is prompted to input a number from 1 to 10,000,000 then the number outputs in english words. For example- please … | |
Ackermann's function is a recursive mathematical algorithm that can be used to test how well a computer performs recursion. Write a function A(m,n) that solves Ackermann's function. Use the following logic in your function: If m=0 then return n+1 If n=0 then return A(m-1,1) Otherwise, return A(m-1, A(m, n-1)) Test … | |
Hello, I need a little help with the correct implementantion of the bisection search algorithm in the following exercise: - with 2 given variables, balance and annual interest rate, calculate the smallest monthly payment so that we can pay off the balance within a year test case: balance = 320000 … | |
code should do this : a) Given an unsorted array of integers, your task is to sort the array by applying the following algorithm (Assume that the input doesn’t contain duplicates ): Execute the following steps starting from the first element in the array: – Count the number of … | |
hi guys...i have a problem concerning strcmpi not equal while inside a while loop. Check out my code below: #include<stdio.h> #include<conio.h> #include<stdlib.h> #include<string.h> main() { char yr[4],new_yr[4]; int x=0; FILE *fp1; printf("Enter Year: ");scanf("%s",new_yr); printf("\n"); printf("You Entered Year %s\n\n",&new_yr); if(strlen(new_yr)==4) { fp1=fopen("year.txt","r"); while(fscanf(fp1,"%s",yr)>0) { if(strcmpi(yr,new_yr)!=0) { fp1=fopen("year.txt","a"); fprintf(fp1,"\n%s",new_yr); fclose(fp1); x=1; … | |
Can anyone help me on this problem, i really have no idea how to do it since i'm new to these stuffs. So please be easy on me. Thanks ! Create the algorithm based on the following requirements: Input: Four grades per student are entered by the user. HINT: accept grade1, grade2, grade3, grade4 … | |
Hi, folks. I have written some pretty complicated programs in Javascript (in terms of the code itself), but I haven’t experimented much with the nuts-and-bolts of Javascript. In particular, I have written all my programs as single blocks of code. For example, I have written several programs to solve for … | |
Hi guys, I am running a costly simulation and trying to optimize the output. I'd have a fixed range over which the parameter of interest can vary, and about 100 values it can take in between. We know the result we are looking for and want to find the parameter … | |
I have to implement Warnsdorff's Rule via an algorithm given to me by my professor. I've gotten it to work however one thing that I can't get to work is for the ending point to be one "knight's move" away from the starting point. This is my code so far. … | |
> HI. I have to make an algorithm for my CMSC class. I was given three problems. Can anyone give me any idea on how to solve these?? Pleaseeeeee. 1. (A1) Given a sequence of numbers, determine the linear equation in the form “an + b.” Example Input: 7 9 … | |
I am trying to develop a method that can find common elements in a simple array with a linear run time O(n + m). This is an old school problem, i.e., no hashsets, hashtables, arraylists. Here is what I have so far. import java.util.*; import java.util.Arrays; public class CommonElements3 { … | |
I am making a mock financial aid account for a project and I wanted to know why my program is not working. Can anyone help me out?? After creating my class, I am trying to access my getName(student_name) function in my main(). It says: "error C2065: 'student_name' : undeclared identifier". … | |
Hi I have the program for inserion of keys into the B tree and displaying them.But i want to write a code for the b tree in C so that each key in the B tree should have 4 attributes. I'm having trouble modifying the structure pointers in the program … | |
http://www.codechef.com/problems/NUKES I'm getting time limit exceeded in my code... Please some one help me out with this code. My algorithm is when A - ((N+1) ^ (p+1)) < 0 then pth chamber will have 1 particle and the new value of A in my recursive function is A - ((N+1) … | |
Hi I need some help with this problem Complete the implementation of linear-time algorithm for Stock Span Problem already I have this code : [CODE]for i=0 to n-1 do done < false while not(D.isEmpty() or done) do if P[i]>=P[D.top()] then D.pop() else done < true if D.isEmpty()then h< -1 else … | |
hello, could anyone help me by suggesting a good approximation algorithm for minimum weight perfect matching on graphs? I can't seem to find anything that makes any sense! i'm trying to implement Christofides algorithm for the travelling salesman problem in java but i'm stuck at the perfect matching bit. any … | |
I am given the amount of data and the time used. It asks for the time complexity. It is in a Big-O packet Below is the first problem given Algorithm A Data Time 1000 .003 2000 .012 4000 .048 8000 .192 Please explain how to get the time complexity. Thanks! | |
I'm trying to display the pegs of the Hanoi Towers recursive algorithm. I want each step to appear separately as such: For example if the number of disks is 2 A: 2 1 B: C: ---------- Move disk 1 from A to B A: 2 B: 1 C: ---------- Move … | |
Hi everyone, I am a student,quite new to C++. I am working on my thesis right now. Here is my situation, I have an algorithm for my thesis topic and I tried making an example of this in C++ and it works fine with a console application. But I am … | |
I need someone to give me Detailed explanation of the game of life algorithm using maggots | |
Is there any method to deal with distributed deadlock when multiple instances are available for each resource type? I think method of wait-for graph and chase algorithm can be used only when single instance of each resource type is available. | |
Hi all. This regards chapter 6 of "Accelerated C++". The program is intended to scan a document and find all the urls in it. I am testing it with just one string input "text http://www.page.com more text". The program is compiling but doesn't run beyond me entering the input. I … |
The End.