All Questions
9 questions
1
vote
2
answers
178
views
A recursive function to reverse string
Write a recursive version of the function reverse(s), which reverses the string s in place.
I'm studying K&R and wrote a code for the question.
...
3
votes
4
answers
363
views
K&R Exercise 1-19. Reverse program input one line at a time
Intro
I'm going through the K&R book (2nd edition, ANSI C ver.) and want to get the most from it: learn (outdated) C and practice problem-solving at the same time. For that reason, I'm trying to ...
2
votes
4
answers
7k
views
Recursive function that reverse the words in a string
I have been working on a problem that asks me to a write recursive function that can reverse the words in a string. For example if the string is "cat is running", then the result should be "running is ...
3
votes
2
answers
246
views
Optimizing string replacement program that uses recursion
I have the following string replacement program for a string of size 256:
I am replacing the string
"\'"
with the string
'
Please suggest any modifications if needed or any mistake I ...
2
votes
1
answer
59
views
Multiplying a numeric string with the "vedic method"
This is vedic method multiplication. This code takes time on a very long numeric string, and I want to optimize it. I also apply recursion on multIndices (this ...
11
votes
2
answers
4k
views
Printing permutations of a given string
I want some feedback on the program I developed in C for printing the permutations of a given string.
...
2
votes
3
answers
728
views
To check if a string C is an interleaving of A and B Code
This is my code to check if a string C is an interleaving of Strings A and B. Please suggests optimizations, and where I can improve.
...
5
votes
2
answers
257
views
Recursive reverse function
Write a recursive version of the function reverse(s), which reverses the string s in place.
Here is my solution:
...
8
votes
3
answers
4k
views
Recursive string reverse function
I'm studying C on K&R and now I'm facing a recursion exercise that states:
Write a recursive version of the function reverse(s), which reverses the string s ...