3,815 Topics

Member Avatar for
Member Avatar for MisterBook

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 …

Member Avatar for MisterBook
0
133
Member Avatar for praky

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 …

Member Avatar for praky
0
4K
Member Avatar for NewOrder

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. …

Member Avatar for NewOrder
0
103
Member Avatar for Tusike

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 …

Member Avatar for Fbody
0
284
Member Avatar for emreesir

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 …

0
50
Member Avatar for gerard4143

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 …

Member Avatar for gerard4143
0
2K
Member Avatar for jorgmen

[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 …

Member Avatar for Reverend Jim
0
269
Member Avatar for asa88

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; …

Member Avatar for NathanOliver
0
2K
Member Avatar for ezkonekgal

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 …

Member Avatar for jon.kiparsky
0
661
Member Avatar for xtra333

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 …

Member Avatar for xtra333
0
2K
Member Avatar for adman_2005

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 …

Member Avatar for jordan00191
0
419
Member Avatar for RehabReda

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 : )

Member Avatar for swinefish
0
177
Member Avatar for guyfrompluto

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.

Member Avatar for Beat_Slayer
0
706
Member Avatar for ashu2401

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 …

Member Avatar for arkoenig
0
329
Member Avatar for radioman28

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). …

Member Avatar for ocmseo
0
668
Member Avatar for gfx

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 …

0
41
Member Avatar for asa88

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 …

Member Avatar for asa88
0
217
Member Avatar for notuserfriendly

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 …

Member Avatar for masijade
-1
2K
Member Avatar for MVideoGms

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> …

Member Avatar for Ancient Dragon
0
185
Member Avatar for ms_farenheit1

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 …

Member Avatar for Ancient Dragon
0
149
Member Avatar for needhelp123

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 …

Member Avatar for GeekByChoiCe
0
88
Member Avatar for needhelp123

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 …

Member Avatar for Rashakil Fol
0
84
Member Avatar for bmos31

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 …

Member Avatar for prvnkmr449
0
180
Member Avatar for mrrko

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 …

Member Avatar for Fbody
0
752
Member Avatar for lucy1234

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.

Member Avatar for Adak
-5
2K
Member Avatar for The Shadows

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 …

Member Avatar for bonethugs
1
418
Member Avatar for needhelp123

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 …

Member Avatar for theiva
0
127
Member Avatar for tron_thomas

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 …

Member Avatar for tron_thomas
0
593
Member Avatar for Garee

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 …

Member Avatar for JamesCherrill
0
86
Member Avatar for Sunshineserene

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? …

Member Avatar for NormR1
0
485
Member Avatar for Kanoisa

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 …

Member Avatar for Kanoisa
0
326
Member Avatar for joelogs

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 …

Member Avatar for jon.kiparsky
0
1K
Member Avatar for noobuser

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. …

Member Avatar for daviddoria
0
116
Member Avatar for Valaraukar

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 …

Member Avatar for Valaraukar
0
180
Member Avatar for group256

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, …

Member Avatar for mike_2000_17
0
119
Member Avatar for ehsantl

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 …

Member Avatar for mrnutty
0
800
Member Avatar for koveras vehcna

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, …

Member Avatar for TrustyTony
0
135
Member Avatar for DaveTran

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 …

Member Avatar for DaveTran
0
112
Member Avatar for iSax

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 <= …

Member Avatar for JamesCherrill
0
99
Member Avatar for Usmaan

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. …

Member Avatar for Geekitygeek
0
198
Member Avatar for teenybopper

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!

Member Avatar for griswolf
0
38
Member Avatar for Ahmedn1

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, …

0
52
Member Avatar for srinivasan106

[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) { …

Member Avatar for ananda2007
0
154
Member Avatar for happygeek

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 …

Member Avatar for Jblover
2
971
Member Avatar for carbonfinger

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. …

Member Avatar for Kanoisa
0
137
Member Avatar for koveras vehcna

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 …

Member Avatar for griswolf
0
256
Member Avatar for quest1

Hi i want to compress data in c++. eg; aaabbcccc then the program shut outpu: a3b2c4 PLZ HELP this is a very important assignment

Member Avatar for StuXYZ
0
143
Member Avatar for Eager Student

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 …

Member Avatar for diannetots
0
283
Member Avatar for rcplguy15

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 …

Member Avatar for daviddoria
0
219
Member Avatar for hazeeel

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 …

Member Avatar for NormR1
0
198

The End.