• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Tim Cooke
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Devaka Cooray
  • Ron McLeod
  • paul wheaton
Saloon Keepers:
  • Tim Moores
  • Piet Souris
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Frits Walraven
  • Scott Selikoff

Recurrence relation for methods

 
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello everyone I came across this question in my textbook but there is no solution for it, so I tried solving it by my own

So can you check it and explain the last part for me

Given Method 1



Method 2:



The first question was what is the function of the both methods: I think that it reverses the given string
however I was stuck at determining the recurrence relation for each method I didn't know how to start or even think so can you help me

Thanks
 
Marshal
Posts: 76830
366
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You cannot reverse a String. You can create a new String which is the reverse of it, or you can display the String forwards or backwards.
 
Marshal
Posts: 8507
610
Mac OS X VI Editor BSD Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

mira pareksha wrote:I came across this question in my textbook

Which textbook? I hope given examples were well indented in that book and you just copied incorrectly. Am I right?
Please keep your code well indented. Should look similar to:


[addition] each separate block suppose to be shifted by four spaces to the right. Don't use tab's as these could be interpreted differently in different environments (OS; editors). In case there is an option in your editor, you could make that tab would behave and be equivalent to four spaces.
 
Tongue wrestling. It's not what you think. And here, take this tiny ad. You'll need it.
the value of filler advertising in 2021
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic