C-Strings-1
Each Project will have Reference Links which you can read to get a quick grasp on the topic and some Practice Questions,If you want more practice for each Topic .
Each Practice Question is slightly abstracted ,You need to make certain assumptions and write the best solution .Think for the best complexity algorithms .Remember also Space vs Time Tradeoff
Reference Links : (Right Click is disabled ,So Ctrl+C and Ctrl+V the links
- http://www.tutorialspoint.com/cprogramming/c_strings.htm
- https://www.eskimo.com/~scs/cclass/notes/sx8.html
- https://www.youtube.com/watch?v=Bf8a6IC1dE8
Practice Questions :
- Implement your own versions of strlen,strcat,strcmp,strstr,strrev .
- Find which character appeared maximum number of times in a String .
- Given a String , convert it into a integer ?
- Given a hexadecimal String ,Convert it into octal string ? Vice versa too .
- Given a alphabatically sorted string , and two letters are interchanged .Find those letters and fix it .
- Given two strings as input which are madeup of digits, find which string is greater ("123">"56")? (Dont convert it into integer and compare .)
- Find two strings are anagrams are not in O(n) ?
How to write good code :
- Name all variables in a meaningfull way
- Use functions to seperate out the independent tasks
- Write good modular code ,and dont over complicate functions with lots of lines .
- Dont over optimize your solutions which results in unreadable code .
- Use comments for lines ,which you feel needs an explanation .
- Always code-review your own code and Refactor whenever possible .
C Strings Code Sample
Program to convert all letters in a String from lowecase to UpperCase ,and uppercase to lowercase .
Bad Code
Good Readable Code