Open In App

String in Data Structure

Last Updated : 11 Dec, 2024
Summarize
Comments
Improve
Suggest changes
Like Article
Like
Save
Share
Report
News Follow

A string is a sequence of characters. The following facts make string an interesting data structure.

  • Small set of elements. Unlike normal array, strings typically have smaller set of items. For example, lowercase English alphabet has only 26 characters. ASCII has only 256 characters.
  • Strings are immutable in programming languages like Java, Python, JavaScript and C#.
  • Many String Problems can optimized using the fact that the character set size is small. For example sorting can be done faster, counting frequencies of items is faster and many interesting interview questions are based on this.

Basics of Strings:

String in different language:

Basic Operations of String:

Please refer String Problems Topic Wise for the list of questions on different topics like binary string, subsequence and substring, pattern searching and palindrome.

Easy Problems on String:

Medium Problems on String:

Hard Problems on String:


Article Tags :
Practice Tags :

Similar Reads

three90RightbarBannerImg
  翻译: