• Post Reply Bookmark Topic Watch Topic
  • New Topic

Recurrence relation for methods  RSS feed

 
mira pareksha
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • 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
 
Campbell Ritchie
Marshal
Posts: 56525
172
  • Mark post as helpful
  • send pies
  • 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.
 
Liutauras Vilda
Sheriff
Posts: 4914
334
BSD
  • Mark post as helpful
  • send pies
  • 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.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!