Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
R Data Structures and Algorithms

You're reading from   R Data Structures and Algorithms Increase speed and performance of your applications with effi cient data structures and algorithms

Arrow left icon
Product type Paperback
Published in Nov 2016
Publisher Packt
ISBN-13 9781786465153
Length 276 pages
Edition 1st Edition
Languages
Tools
Arrow right icon
Authors (2):
Arrow left icon
Achyutuni Sri Krishna Rao Achyutuni Sri Krishna Rao
Author Profile Icon Achyutuni Sri Krishna Rao
Achyutuni Sri Krishna Rao
PKS Prakash PKS Prakash
Author Profile Icon PKS Prakash
PKS Prakash
Arrow right icon
View More author details
Toc

Exercises


  1. One of the classic problems is the Tower of Hanoi, inspired by Hindu temples, where priests are provided with three poles of 64 gold disks, and each disk is a little smaller than the one beneath it, as shown in the following figure:

    • The task is to transfer all 64 disks from one pole to another with two constraints, that is, only one disk can be moved at a time, and that they cannot place a larger disk on smaller one. Write a dynamic programming-based approach to solve the Tower of Hanoi problem.

  2. Implement a function that gets the edit distance of two input strings, where the edit distance is defined as insertion, deletion, and substitution. The function should determine the minimal number of edit distance required to modify one distance to another.

  3. Given a rope of length n, write a function to determine how to cut the rope into m parts with length l[0], l[1], and so on until l[m] so that the product of each part is maximum. The rope needs to be cut as an integer with a minimum of...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Banner background image