3,815 Topics
![]() | |
Hello, Can some one give me a hand on my search algorithm? I know it's not working right and am not sure how to make it work properly. It is on line #'s 69 to 73. It has to search for the name that is already stored in the array … | |
Hey everyone, I currently am creating a Card shuffling program in C++, Ive taken care of the shuffling of the deck. Now I just need to distribute a hand of 5 cards, and determine hands. Can anyone help? Please! cardheader.h ( includes both Class Card & Deck ) [CODE] #ifndef … | |
I need some help with this program, im obviously not so good with this stuff, but since this is the only one i haev left to make i thought i would ask some of you guys for help the problem is: Write separate programs to do the following: 1) Convert … | |
Okay I have tried everything to alter the code but nothing works, so I ask for your help. The thing is I am trying to turn my code from this: *______* **____** ***__*** ******** ***__*** **____** *______* into this: *________* **______** ***____*** ********** ***_**_*** **__**__** *___**___* ____** ____** ____** ____** … | |
Hi i am trying to think of how the algorithm of how this question works but no matter how hard i tried, i cant think of it. Can anyone give me a hand?? Any help or tip would be greatly appreciated. Question: Given 3 classes, equilateral triangle, isosceles triangle and … | |
As the title says: Is the XOR Swap algorithm still viable? I know that temp-swaps are supposedly faster but the shear coolness of an XOR swap makes it more attractive to me. What do you guys/gals think? For anyone that doesn't know what an XOR swap is here goes [code=c++] … | |
Hello, everybody! I am kind of new to the forums, and I will do my best to follow the rules when posting a new thread. I am to create a program that is supposed to generate 30 random integers between 10 and 200, and insert them into a Heap. The … | |
Hello. I have encountered a following problem "find all duplicate letters in a 2d char array and replace them with '@'" So for instance if I have this : a a b c The output would be @ @ b c So. I have come up with the following algorithm … | |
I am using dijkstra's algorithm to try to gather fake street names and find the shortest path. However, I can only get numbers to work instead of strings... The example of my results is below. [B]Results:[/B] The shortest route from 0 to 1 is : From Street 0 to Street … | |
Hello everyone, I am doing a graphics app in C# for a school asignment. I have to make some geometric 3D figures spin around, translate and scale, not too much of a deal, i guess. But there is an issue i do not know to solve: When switching from 'wireframe' … | |
I am doing a project on developing a one time password system. In that, I have to encrypt a counter value and secret key together by HMAC SHA 1 algorithm. But the counter value and key need to be stored very safely on the server. Is there anyway by which … | |
I have this code where I have to implement binary search by first using the selection sort algorithm in mips My selection sort works but trying to use the sorted list to execute a binary search is where my problem comes. I get an error saying is out of range. … | |
hi, so i've been looking for a string matching algorithm that gives me a "rating" based on how close the 2 strings match.. luckily, i googled and read this article: [URL="http://www.catalysoft.com/articles/strikeamatch.html"]how to strike a match[/URL] here's the original java class code [CODE=java] package strike_a_match; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; … | |
Ok, I have two pieces of code, this is my FIRST time ever trying to do a SPIM coding, so forgive me if this is a total trainwreck. :) [B] I will FIRST post the question, along with pseudo code of what it is suppose to do. THEN I will … | |
Hey guys. I'm writing an heap-sort algorithm (code is below) but for someone reason my restore_heap function is incorrect somewhere. I understand how the algorithm is working. do y'all have any suggestions? #include <iostream> #include <stdio.h> #include <vector> #include <cmath> #include <ctime> #include <algorithm> using namespace std; # if 0 … | |
[CODE]#include <iostream> #include <string> using namespace std; int GCD(int x, int y); int main () { int ans, num, a, b, c, d, e, f, g, y; int h = 0; int w = 0; char ans2; char ans3; cout << "[1] Math algorithms " << endl; cout << "[2] … | |
Can someone please help me calculate the time complexity of this loop? (Toggle Plain Text) for(i = 1; i <= n; i = 2 * i) for(j = 1; j <= i; j = 2 * j) for(i = 1; i <= n; i = 2 * i) for(j = … | |
I've recently taken up an AP Computer Science class online for Maryland State education at my high school, and was wondering if I could receive help on a few of the projects. Most of them are simple like programs I made in Visual Basic for my first programming class with … | |
I made a simple color finding game. the problem is that my color input guess is not good so complex I want them in one line and also I want to see my tries at certain places. can you help me thanks in advance. [CODE]#include <cstdlib> #include <iostream> #include <string> … | |
Hi, I have just started python as after a chat with a friend I have discovered it would be the most suitable language for my latest project. The problem I have come across is I need a sha1 function written in python. I don't want to use the built in … | |
Can you please suggest an algorithm that uses pointers and I also have to read and save the text file, which I#m having trouble with. Here is a rough translation of the task into English(I used google translator so it's bit jumbled, my german's not that good): Define a structure … | |
I am an absolute beginner to programming. I started a programming course recently. I have a task which basically involves coding a first fit algorithm. The task is to design and implement a program to pack items into containers using first fit algorithm. A container has an arbitrary capacity. The … | |
Hello, I would like to ask if you can give me some help. I have to implement a slicing tree that represent a slicing floorplan(slicing floorplan divides a rectangle with horizontal and vertical cuts, and can be represented by a binary tree, called slicing tree. Its internal nodes are the … | |
Dear friends ....... I am doing a biometric project , so i need a Finger print recognition algorithm and its code in java....... So i request you to help me............ Anyway thank you May GOD bless you Thanks in advance. | |
Dear friends ....... I am doing a biometric project , so i need a face reconition algorithm and its code in java....... So i request you to help me............ Anyway thank you May GOD bless you Thanks in advance. | |
Hi all, I have written a simple function to compute factorial in C++. It computes OK until 31! which is 738197504. Now for factorial 32 it gives me a negative result and for 34 it gives me 0. I know that on my machine LONG_MAX is 2147483647. So in my … | |
I'm supposed to modify this method ([url]http://pastebin.com/6xF1pN51[/url]) to this (translated): "A faster algorithm to compute the average can be done by looping through the entire image in two passes in each session and make a one-dimensional mean value. In the first pass compute the mean value of the y-axis (one … | |
Hi, I was trying to code the shell sort algorithm ,which compares data over distances of n/2,then n/4,n/8 and so on till the array finally gets sorted .As far I understood I implemented the code as follows but it doesn't seem to work.Can someone help! here is the c code[code=c] … | |
**Write a algorithm to accept 5 number and sort it in the ascending order using selection sort** #include<iostream.h> #include<conio.h> class selectionsort { Int a[100], n, i, j, temp, loc, min ; public: void in( ) ; void out( ) ; selectionsort( ) { Min = a[0] ; } }; void … | |
Hello people, I decided to make a family tree as a graduation project, I've thought about multiple ways to make it, but I like some fresh ideas, in case i forgot some things. I'm trying to keep the project as easy as possible, because in the end I will need … | |
For lines 23 and 22 it says "you cannot assign to a variable that is constant." anyone know how to fix this? thanks in advanced, bookmark. [CODE]#include <iostream> #include <string> #include <algorithm> using namespace std; void print (const string & s); string reverse(const string & s); int main(){ print("blah"); reverse("blah"); … | |
![]() | How could this be implemented? Thank you :) |
Environment: eclipse I have reached a snag with finding the perfect numbers from 0 - 1000 while using methods with multiple perimeters, one project, tow classes. There is an example on this site from quite a while ago within one single class. That is in a later chapter in my … | |
Hi guys, can anyone help me determine the step counts of the following instructions in terms of n? for i = 1 to 2 * n j = i + 1 while j >= 1 j = j – 1 Thank you! | |
I am having trouble printing the contents of a b-tree of order 'n' in level order. I have looked at algorithms online, but they only cover trees that have nodes with only 2 children. Shouldn't it also be called recursively? No algorithm I found used recursion. [CODE]void addToQue(struct node *root) … | |
Hello, I want to sort a 2dim array by columns, but there is an error in my code. It doesn't accept value of element from 2dim array into C[x]. Can anybody help please? [code=C++] static int counting_sortx( int** A[], int** B[], int k, int rows, int col){ /*Array A[ ] … | |
[B]Problem statement:[/B] Give two sets [TEX]A[/TEX] and [TEX]B[/TEX], devise and algorithm that checks if A and B are [URL="http://en.wikipedia.org/wiki/Disjoint_sets"]disjoint[/URL]. The following information are given about the set [TEX]A[/TEX] and [TEX]B[/TEX]: [LIST=1] [*][TEX]|A| = |B| = n[/TEX], that is number of elements in both sets are n [*]A and B are … | |
Hi, The following code works fine: [code=c] // main.cpp #include "Dog.h" void details(Dog x){ cout << x.height << endl;} int main() { int h,w; vector<Dog> vect; cout << "Please enter 3 dogs measurements: "<< endl; for(int i=0; i<3; i++){ cout <<"\nInput height:" <<endl ; cin>> h; cout <<"Input weight:" <<endl … | |
Hey guys! Much help needed here! I am a student doing a protein structure alignment algorithm which is my final year project, using various forms of translation, rotation & computing the RMSD. From line 164: This is my loop calculation, basically it computes the Root Mean Square Deviation (RMSD) of … | |
[COLOR="Red"]I have an assignment from my data structures course.We learn almost nothing about C++.But they gave that assignment,and said do it anyway.Many of my classmates have it done with money.But I wanna learn how to make this project by myself.I'm thinking about the structure for 5 days and nights.I wanna … | |
Hello This is Nikil.Can anyone help me out how to calculate time and space complexity of an algorithm with examples.I am in very much need.Please help me out in detail. | |
Hi, I am having some trouble writing this code. The question is as follows: The Sieve of Erastophenes is an algorithm -- known to ancient greeks -- that finds all prime numbers up to a given number n. It does this by first creating a list L from 2 to … | |
Most of the posts here are from people with problems, looking for help. I thought I would try to talk a bit about ways to find your way out of "stuck". It's been on my mind lately, since I've been wrestling with Swing and it's been winning. Finally worked out … | |
Hi all I have a empty GUI , what i need to do now is to put the algorithms I have into the GUI. Im not very sure how im supposed to go about doing it. Calling of files would be easier to me as i do not have to … | |
Hello, I have an assignment where we are supposed to populate an operating system's ready queue with processes and try various process scheduling scheme and record their wait times. To do this i made a rudimentary structure for a process: [CODE]typedef struct{ int ID; int wait_time; int exec_time; }process; [/CODE] … | |
Hi every body, I have implemented simple k-NN (without features weight) machine learning method. Now I have to implement k-NN with features weight. I chosen ReliefF machine learning method to weight features. Are there someone tell me the way to implement ReliefF to weight features? I had a 1000 instance … | |
Hi guys, I'm trying to learn the principles of artificial intelligence. I just finished coding up a belief net and a corresponding EM algorithm that learns the CPTs for latent nodes using training data (if you're unfamiliar with the lingo, you're probably going :eek: right now). While the program (written … | |
Hello there I am implementing heap sort by maintaining min heap property. It is working fine but the order is descending, I want ascending order. One way is to invert the output array and get the desired output but this is not what I want. Like in min heap root … | |
can anyone please suggest few algorithms to predict protein structure - topic may come under datamining in bioinformatics | |
write a pseudocode algorithm tp prompt the user to enter a number and it should tell if the number is odd or even.........i need help |
The End.