Initial commit
This commit is contained in:
commit
15c381aaae
19 changed files with 828 additions and 0 deletions
25
count_char.c
Normal file
25
count_char.c
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
/*----------------------------------------------------------
|
||||
* HTBLA-Leonding
|
||||
* ---------------------------------------------------------
|
||||
* Title: Count Character Occurrence
|
||||
* Author: */ your name /*
|
||||
* ----------------------------------------------------------
|
||||
* Description:
|
||||
* Recursive and iterative implementation of an algorithm that
|
||||
* counts the occurrences of a specific character within a string.
|
||||
* ----------------------------------------------------------
|
||||
*/
|
||||
|
||||
/*
|
||||
Instructions:
|
||||
|
||||
Define a function count_char(s, c) that takes a string `s` and the character 'c' to count as input.
|
||||
Increase the counter by one, if the character matches the character at
|
||||
the current position within the string and add the count of that character in the remaining string
|
||||
until the end of the string ('\0').
|
||||
|
||||
*/
|
||||
|
||||
// TODO: the recursive implementation
|
||||
|
||||
// TODO: the iterative implementation
|
||||
Loading…
Add table
Add a link
Reference in a new issue