- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Explain the concept of strings in TOC?
A string over an alphabet is a finite sequence of letters from the alphabet.
Examples
toc, money, c, and adedwxq are strings over the alphabet ∑ = {a, b, c, . . . , z}.
84029 is a string over the alphabet ∑ = {0, 1, 2, . . . , 9}.
Empty String
The empty string or null string, denoted by ∧, is the string consisting of no letters, no matter what type of language we are considering.
String concatenation
Given two strings w1 and w2, we define the concatenation of w1 and w2 to be the string as w1w2.
Examples
If w1 = pq and w2 = r, then w1w2 = pqr.
If w1 = acc and w2 = ac, then w1w2 = accac and w2w1 = acacc.
If w1 = ∧ and w2 = cd, then w1w2 = cd.
If w1 = aa and w2 = ∧, then w1w2 = aa.
If w1 = ∧ and w2 = ∧, then w1w2 = ∧; because ∧∧ = ∧.
For any string w, we can define wn for n ≥ 0 inductively as follows −
w0 = ∧;
wn+1 = wnw for any n ≥ 0.
Example
If w = man, then w
0 = ∧, w
1 =mam, w
2 = mammam, w
3 = mammammam,
and so on.
Substring
Given a string s, substring of s is any part of the string s means w is a substring of s, if there exist strings x and y (either or both possibly null) such that s = xwy.
Examples
Take the string 472828. Then ∧, 282, 4, and 472828 are all substrings of 472828.
48 is not a substring of 472828.
- Related Articles
- Explain the concept of derivation in TOC
- Explain the concept of grammar in TOC
- Explain the concept of set in TOC?
- Explain the concept of state elimination method in TOC
- Explain the concept of amalgamation
- Explain the power of an alphabet in TOC.
- Explain the various applications of automata in TOC
- Explain the concept of depreciation in accounting.
- Explain the concept of depletion in accounting.
- Explain the concept of delegates in C#
- Explain the concept of takeover in business
- Explain the concept of Normalization in DBMS?
- Explain the concept of recoverability in DBMS
- Explain the concept of indexing in DBMS
- Explain the concept of nutrients in animals.
