Describe an interesting problem and how you solved it.
Answer / Archana Kumari
An interesting problem I encountered was the Tower of Hanoi. The goal is to move a stack of n disks from one peg to another using a third peg as auxiliary, with the following conditions: only one disk can be moved at a time, no disk may be placed on top of a smaller disk, and all disks are initially on one peg in decreasing order by size. To solve this problem recursively, I implemented a helper function that moves n-1 disks from the source peg to the auxiliary peg, moves the largest disk from the source peg to the destination peg, and then moves the n-1 disks from the auxiliary peg to the destination peg. The base case is when there is only one disk (n = 1), which can be moved directly from the source to the destination.
| Is This Answer Correct ? | 0 Yes | 0 No |
tell me about your college life
what support training would you require to be able to do this job?
Responsibilities at a bank are pressing. Can you shoulder them?
1 Answers Bank of Maharashtra,
Why did you apply for this particular job?
Tell me the courses you liked and why did you like them.
What are your career plans at PNC Bank?
1 Answers PNC Bank Financial Services,
is it possible to implement only sap hr without fico?
what do you prefer- hard work or smart work?
Who inspired you in your life and tell me your family background?
How would you find the second largest element in an array using minimum no of comparisons?
What do you know about our bank?
You have switched 3 jobs in 2 years - why?
Programming Languages (22694)
Scripts (9273)
Networking (2571)
Microsoft Related (21566)
Databases (16609)
Operating Systems (11983)
Testing (17995)
Servers (1375)
MainFrame (6620)
Java Related (15396)
Middleware (526)
Web Related (7038)
Data Warehouse (8975)
HR Questions (2698)
Software Design (1923)
Debugging (73)
Version Control (464)
Editors (229)
Telecom (1164)
ERP CRM (26477)
Embedded Systems (1221)
Client Server (333)
Artificial Intelligence (3276)
Cryptography (718)
EAI (466)
Multimedia (644)
Software Development Life Cycle (303)
Image Processing (170)
Mobile OS (3116)
Security (125)
Big Data (4325)
Cloud Computing (1789)
Automation (2674)
Internet of Things (IoT) (299)
Apache Related (370)
Frameworks Tools (1329)
Oracle Related (0)