0% found this document useful (0 votes)
22 views

String Programs

This document contains descriptions of various string manipulation problems and their time and space complexities. It includes problems such as reversing a string, checking if a string is a palindrome, counting words, checking if two strings are the same, updating or removing characters, sorting characters, and more. It also provides links to related problems on LeetCode and examples of additional string challenges like swapping strings, converting a string to an integer, and checking string permutations.

Uploaded by

Rushit Savani
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
22 views

String Programs

This document contains descriptions of various string manipulation problems and their time and space complexities. It includes problems such as reversing a string, checking if a string is a palindrome, counting words, checking if two strings are the same, updating or removing characters, sorting characters, and more. It also provides links to related problems on LeetCode and examples of additional string challenges like swapping strings, converting a string to an integer, and checking string permutations.

Uploaded by

Rushit Savani
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

1.

Reverse a String
2. check if a String is Palindrome?
3. count number of words in a String (with / without split function)
4. Program to check if two strings are same or not (without using inbuilt function
.equals())
5. Update a character in a string (without using .replace() function)
6. Sort string of characters
7. Print frequency of all the characters in string
8. Remove Vowels from a String
9. Reverse Words internally in a String
10. find duplicate chars from string
11. remove All Digits
12. Merge Strings Alternatively
13. Check if all words are palindrome
14. Check if string have equal digits and chars
15. Remove duplicate chars from string

https://leetcode.com/problems/check-if-two-string-arrays-are-equivalent/
https://leetcode.com/problems/truncate-sentence/
https://leetcode.com/problems/find-first-palindromic-string-in-the-array/
https://leetcode.com/problems/counting-words-with-a-given-prefix/
https://leetcode.com/problems/maximum-number-of-words-found-in-sentences
String test

1. Swap two strings of same size without using third string


TC O(n), ASC O(1)

2. Convert a string into an integer without using Integer.parseInt() function


TC O(n), ASC O(1)
Ex "123" -> 123.

3. Check if two strings are permutation of each other or not?


TC O(n), ASC O(1)
Ex s1=”abac” s2=”aabc” -> true
s1=”abac” s2=”abc” -> false

4. Pattern:
P
PR
PRO
PROG
PROGR
PROGRA
PROGRAM

You might also like