3,815 Topics
![]() | |
I've written a flexible quicksort module capable of taking a vector reference pass, cloning it, altering the clone and swapping with the original to print the list. For the most part, this works wonderfully, except for one thing. Occasionally, it gets numbers wrong. Not all the time. If I give … | |
i am writing a program on huffman's code in C++. I have wriiten the program till building the huffman tree. now I have to generate the code by traversing the huffman tree. I have no idea how to do that logically. please help with code or algorithm. Here is my … | |
i want to move a bishop diagonally from one point to another i want to move it from (row=8,column=3) to (row=7,column=2) the move is valid but i want to secure it against any collision with another piece. so i am running an loop from the initial position to the next. … | |
Hi! I've been trying to create an amoeba program that is smart enough to beat me. So far I didn't really succeed. Please read how I approached the problem, and if you have other ideas of solving it or suggestions, tell me! OK, so basically in amoeba the program looks … | |
Hi, I have a problem that is shortest path problem. I use dijkstra algorithm but query has a time that is an hour on 280.000 node-graph. I have to reduce query time to 1 second. I try to find these way but I can not found any implementation of these … | |
Could someone please verify. Is it proper to have pointers to containers(vectors in this example) where you allocate memory for them and then free them. I googled and found a posting that stated its considered poor coding style to do this...I doesn't seem like it should be poor programming style … | |
[B]Please help... I need an algorithm for generate sudokus. i searched in the web, but there´s only algorithms in action scrip, java, c, c# or c++, i need it in scheme... why is so difficult find help for scheme expressions ´n algorithms?? if there someone who can give me a … | |
I trying to read in from a file but getting runtime errors can some one help find the .txt file as an attachment [CODE]#include<iostream> #include<set> #include<stack> #include<queue> #include<algorithm> #include<fstream> using namespace std; int main() { const int size= 7; char input[size]; fstream nameFile; nameFile.open("words.txt"); if(!nameFile) { cout<<"error cannot open file"<<endl; … | |
Hello. Anyone familiar with the Halstead product metrics? we are going to implement it. and again i need some help. here is our algorithm: 1. The user runs the program. 2. The program will ask the user to browse the file he/she wants to be evaluated using the programer's own … | |
Hi Guys. I am new here. I am trying to run a Poker program that can detect the different hands in poker. here is my code [CODE] class Card: # A card is an Object with a suit and rank # attributes. def __init__(self, rank, suit): # To create a … | |
The program initially asks the user to insert the secret sentence and the encryption code (an integer number in the range 1-100). Then, the program calls a user-defined function void encrypter (char *, int) that accepts the string pointer and the encryption code. The encryption algorithm is based on the … | |
hi all hope that all of u are fine : ) well i want to draw a tree [B]not a binary tree[/B] but i can't find an efficient algorithm to draw it the big problem when the tree is unbalanced Thanks ur help will be greatly appreciated : ) | |
I need to write a function that takes in an array of integers and an integer, checks if the sum of any of the numbers in the array is equal to the supplied integer. Any ideas would be much appreciated. | |
Hi, I was recently asked this question in an interview and I was wondering if any of you could help me find a better solution to this problem. The question goes like this: There is a function foo which takes two arguments: an array "a" of type int and another … | |
Hi, I am a almost thirtysomething, going back to school at night while working full time. I decided that it was time to get an education to enable me to break out of the Cable industry and into the programming scene. I am interested in Computer Science and web programming(maybe). … | |
HI, I have an excersise for school but don't know if I solve it correctly so maybe is here a good place for my questions. It's a Breadth-first search algorithm. here is a picture. [URL="http://www.shrani.si/f/2b/SK/2SKKVUSy/drawing1.jpg"]http://www.shrani.si/f/2b/SK/2SKKVUSy/drawing1.jpg[/URL] now I have to resolve these (start with node 2) : This is my table … | |
i made a vector class "MyVector" inherited from a base class "arrayList" which is derived from a base class linearlist. whenever i compile i get a fatal error: [COLOR="Red"]LINK : fatal error LNK1561: entry point must be defined[/COLOR] [CODE]// abstract class linearList // abstract data type specification for linear list … | |
Pretty much i can convert from infix to postfix really well and that is nto the problem i need help with the postfix evaluation also i dont think my evaluate method is correct i have two push methods, one for char and one for int. i really am stuck and … | |
I keep getting this error and I can't figure out what is wrong. error C2227: left of '->capacity' must point to class/struct/union/generic type 1> type is 'int *' Here is the class header and declaration that I am working on. [CODE]#ifndef MYVECTOR_H #define MYVECTOR_H #include <iostream> //#include <sstream> //#include <string> … | |
I am working on an application and would like to be able to calculate the efficiency of various algorithms and choose the best one. The application operates on a list of records that are stored in a file. Operations include adding records, deleting records, and searching for records based on … | |
WHERE IS MY Problem. Develop a COMPLETE algorithm using pseudo code to solve the following problem: Your network contains hundreds of workstations. The primary local drive (C on each of those workstations may contain many folders immediately under the root folder. You need to search each of the folders under … | |
WHERE IS MY Problem. Develop a COMPLETE algorithm using pseudo code to solve the following problem: Your network contains hundreds of workstations. The primary local drive (C on each of those workstations may contain many folders immediately under the root folder. You need to search each of the folders under … | |
Ok, so I'm writing a program to convert decimal into binary. It all works with the exception that my binary shows up in reverse order and I'm having trouble with reversing the array of chars in my intToBinaryString() function. Any tips on how to get this started? [CODE]#include<iostream> #include<cstring> using … | |
Hi everyone. Im from Puerto Rico, and Im studying Computing Science. Im actually taking my first course of programming, and it is called "Introduction to computer programming", and we are programming with C++. At this point almost everything has been theory, but now we are starting with practice, and I … | |
hello, i need to do 15 puzzle algorithm in C as a part of my assignment.Can i please get help for this?? thanku, lucy. | |
Hi, I have to write an address book using structs for a class. I have 90% of the code done, but I am having trouble ordering it. It is supposed to read in 10 entries from a file and then sort them by last name. All the information also has … | |
WHERE IS MY Problem. Develop a COMPLETE algorithm using pseudo code to solve the following problem: Your network contains hundreds of workstations. The primary local drive (C:) on each of those workstations may contain many folders immediately under the root folder. You need to search each of the folders under … | |
I have a situation whereby I need to copy the contents of an STL vector into a memory buffer provided by the system. One might think that given: [CODE]std::vector<ObjectType> source; // Initalized to hold the objects ObjectType* target = reinterpret_cast<ObjectType*>(buffer); // Points to system provided memory buffer[/CODE] someone could do … | |
I recently wrote a short program for an exercise in a textbook. After completion however I re-structured the program to use methods instead of one long main method. My question: Which way of programming should I be using? I am leaning more towards the methods as it is much more … | |
Hi, I have this program that part of it is hard coded. Instead of hard coding it, I need to do a file read instead. Meaning, the hard coded part must be changed to reading the info I need from a txt file. May I know how to do that? … | |
Hi guys. Been coding away today decided that i would update an old program i did a while ago which was the base of an organisor application. So today i converted it to use STL instead of my hardcoded double linked class. I used list<> as my original implimentation was … | |
we are given the assignment to implement the banker's algorithm in c. this implementation must run in the linux terminal and program must be utilized the os in the time of execution. this means that it must capable on real-time execution with the os. i really don't have any idea … | |
Hi, Please help me with this problem, im reading algorithms i've seen a problem called "Coin Change" the algorithm located here: [url]http://www.algorithmist.com/index.php/Coin_Change[/url] i have problem in implementation in C++, can anyone please help me with the base case. I have no idea how to fill the array with base cases. … | |
So, I have been working on some code with a group of people/organisations etc. and I've hit a small bump in the road that I thought someone on here may be able to help me with :) I have developed some code that draws 3D towers to represent the amount … | |
Hi everyone, I have been playing with a piece of code that is to simulate "shortest job scheduler" for almost 2 days and there is a runtime bug which it's seems I am not able to find. Any help is really appreciated. Here is the code: [CODE] int sjf_scheduler(int number_of_jobs, … | |
Hi folks I'm trying to do my assignment in c++, I suppose to develope a maze traversal using backtracking algorithm. I have to write a constructor for my Maze with this sign. [CODE]Maze(**c, int size); [/CODE] which takes a n-by-n two-dimensional character array. Can you guide how can pass an … | |
Hello everyone, I'm working on a random text generator -without using Markov chains- and currently it works without too many problems -actually generates a good amount of random sentences by my criteria but I want to make it even more accurate to prevent as many sentence repeats as possible-. Firstly, … | |
I've created an algorithm that draws a 2D grid in the most efficient way I could think of. Suggestions to improve it are encouraged though :) [CODE] public void DrawWireGrid(int xDivisions, int yDivisions, int cellSize, Color color) { Vector3 a = new Vector3(); Vector3 b = new Vector3(); for (int … | |
I am a newbie in Java programming. There're one question requesting us to construct an algorithm to sum up all the odd numbers from 0 to 100. Is this consider an algorithm? • Start • set sum to 0 • set number counter to 1 • while number counter <= … | |
Hi Folks, I'm making a Calculator on Visual Studio (Nope, it's not a College or University assignment). I'm at the part where I have added code to all of the number buttons but now need to see how the program is going to calculate sums of x amount of numbers. … | |
Hello, I need to write a shell script that performs encryption and decryption using AES algorithm. I could not find any resource online, can anyone please help me in the right direction? Thank you for the help! | |
here an ajax code with javascript I just want to understand the algorithm as I'm very new :) here is the code [CODE] function check() { if (!checking) { id = getId(); if(!isValidId(id)) return; checking = true; $.ajax({ url: '/getit.php', data: 'id=' + encode(id) + "&t=" + getRandom(), cache: false, … | |
[B]this program is to find maximum and minimum using divide and conquer technique[/B] [CODE=C]int min=32000,max=0; void maxi(int [],int,int),merge(int [],int,int,int,int); void main() { int a[30],n,i; printf("enter the limit\n"); scanf("%d",&n); printf("enter the aray elements\n"); for(i=0;i<n;i++) scanf("%d",&a[i]); maxi(a,0,n-1); printf("maximum is %d and minimum is %d\n",max,min); getch(); } void maxi(int a[],int first,int last) { … | |
Justin Bieber is, so my 10 year old daughter informs me, a pop sensation. Actually, her exact words when I asked just who the heck this Bieber bloke who keeps topping the Twitter trending chart is were: Oh My God, Justin Bieber, he's gorgeous. A little more journalistic investigation turned … | |
Hey guys I'm writing a program that profiles the speed of different algorithms and I have been using the getTickCount() method in order to do so. However the program is reporting that the algorithm took 0ms. Doesn't have to be too accurate but currently 'RunTime' is coming up as 0. … | |
Hello everyone, I am currently working on a code and I got stuck in a part. My algorithm is a text generator that operates on project Gutenberg and its flow is like this: Enter a sentence as input 1-Pick longest word of input sentence 2-Search the longest word of the … | |
Hi i want to compress data in c++. eg; aaabbcccc then the program shut outpu: a3b2c4 PLZ HELP this is a very important assignment | |
Hi! to everyone I'm starting out in programming,I need a pseudocode or flowcharting to use to help me get started on coding. Often, when I take a look at a coding assignment, it looks daunting, and it's hard to figure out exactly where to start. Especially with all of that … | |
Hello, I got this question for my weekly c++ exercise: Imagine you want to solve the following problem. Given a date (of the form dd/mm/yyyy and day of the week) and a non-negative integer n, you want to determine which date it is after n days. For instance, Given Thursday … | |
Hi all, I need to do a translation using 2D arrays for my Superposition algorithm. Translation: I plan to use the CA(Alpha carbon) as my invariant point which is usually the 2nd line in the pdb.txt file. So how go about doing that? Must I use an orthogonal matrix? Or … |
The End.