Initial commit

This commit is contained in:
github-classroom[bot] 2025-01-07 06:46:34 +00:00 committed by GitHub
commit 15c381aaae
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
19 changed files with 828 additions and 0 deletions

25
reverse_string.c Normal file
View file

@ -0,0 +1,25 @@
/*----------------------------------------------------------
* HTBLA-Leonding / Class: <your class>
* ---------------------------------------------------------
* Title: Reverse String
* Author: */ your name /*
* ----------------------------------------------------------
* Description:
* Recursive and iterative implementation of an algorithm that
* reverses a given string.
* ----------------------------------------------------------
*/
/*
Instructions:
Define a function reverse_string(s) that takes a string `s` as input.
Take the last character of `s` and concatenate it with the result of reversing the rest of the string until the string has less than two characters.
Note that strings that are stored on heap or stack are provided - they can be directly manipulated.
*/
// TODO: the recursive implementation
// TODO: the iterative implementation