๐ DSA with C – Day 5: Strings in C
๐ฏ Goal:
-
Understand how strings work in C
-
Perform common string operations:
-
Reverse a string
-
Check for palindrome
-
Count character frequency
-
Check if two strings are anagrams
-
๐ง What is a String in C?
A string is a character array ending with a null character (
\0
).
๐ง Declaration
๐ฅ Input
๐จ๐ป 1. Reverse a String
๐จ๐ป 2. Check if a String is a Palindrome
๐จ๐ป 3. Character Frequency Count
๐จ๐ป 4. Check if Two Strings Are Anagrams
Two strings are anagrams if they contain the same characters in any order.
๐งช Practice Problems:
-
Count vowels and consonants in a string.
-
Convert lowercase letters to uppercase.
-
Remove duplicate characters from a string.
-
Check if two strings are rotations of each other (e.g.,
abc
andcab
).
๐ Homework for Day 5:
-
Implement your own versions of:
-
strlen()
-
strcpy()
-
strcmp()
-
-
Try a string problem from LeetCode: Valid Anagram
Comments
Post a Comment