|
by: Sonia |
last post by:
Hi,
I have written this code for the Tower of Hanoi problem. I was just
wondering if there is any way of optimizing this code ?
It's a failry simple code, but I thought that maybe somehow it could be
improved. Please let me know. Thanks
#include <iostream>
using std::cout;
|
by: elsheikhmh |
last post by:
Constant wrote:
>
> I need a programe that will deal with the solving of the problem ..i
> have 3 pegs A, B, C...and I want to move the disk A to disk C using B
> as auxiliary.At the end all disk should be at peg C in the same order
> as in the beginning.
> I do not know how to solve this problem because I have only basic
> skill in C++
check:
|
by: Marco Ippolito |
last post by:
Hi,
I am giving a seminar on C# interop and I would like to feature an original
sample class to stimulate some interest.
Does anybody want to write an open-source ConsoleApp || WinApp that, given a
starting English word, calls Babylon for translations in N languages and
plays a game with the user assigning one point for every
language/translation pair entered? (I am a licenced user for 2004 :-)
|
by: ashishnh33 |
last post by:
hi.......is there nyone to tell me how to solve the "tower of hanoi"
problems
|
by: huzaifaa |
last post by:
The Towers of Hanoi is an old famous puzzle. The task is to build a program (in assembly language for the simulator of the 6800 used in the tutorial) that, given one input value (that indicates the number of disc in the left most peg) computes the minimum number of steps required to move the tower to the left most peg.
Can any one help me out with this?
|
|
by: kamvisiouma |
last post by:
Hi there, I'm fresh in learning c++ and I have to solve an exercise
with hanoi and my problem is that I'm running out of time!
The exercise is this, and I have to complete the ???
#include<stdio.h>
#define DISK_NUMBER 4
// There are 3 towers represents 3 stacks
// The names of the disks are represented by numbers (1,2,3,...,n)
|
by: shaghayeghcute2003 |
last post by:
I'm currently trying to write The Tower Of Hanoi (http://
illuminations.nctm.org/ActivityDetail.aspx?ID=40) in C#.
I have a panel on the form and I draw pegs on the panel inside the
form class. I passed GraphicObject to drawDisk method in disk class to
draw disks' pictures.
I used MouseDown/Up/Move to move these disks on the panel.
I'm attaching some part of my code:
private void panel1_MouseDown(object sender,...
|
by: seemanikam |
last post by:
Can anyone suggest me how to devise an efficient divide-and-conquer algorithm for the Tower-of-Hanoi problem when the disks are colored alternately red and blue, and with the extra rule that no disk may be placed on any other disk of the same color.
|
by: 960392954 |
last post by:
The Towers of Hanoi is a famous problem about moving a certain number
of disks from one peg to another.I write a recursive program for it.If
you have known it ,you can skip the program.
#include <stdio.h>
void hanoi(int num,char initial,char terminal,char temporary);
void main (){
int num;/*num is the number of disks of the initial peg*/
char a='a',b='b',c='c';
/*a is the initial peg ,c is the terminal peg,b is used as a temporary
peg*/
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
|
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
|
|
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
|