0 votes
82 views
Consider the string “GATE2000”, the number of non-trivial substrings of given string are

i am constatly confused in these types of substrings questions please specify some resource or plzz derive how to solve these questions
| 82 views
0
non-trivial means the substring's excluding $\varepsilon$ and the string itself.
0
hmm whats answer of above
0
35 ?
0
it is  32 but close enough whats approach
0
Total 37 substring, 35 are non-trvial and

total 2 ^8 subsequence.
+3
count the number of substrings it would be 8*9/2 = 36

000 -- three 1 length substrings 0,0,0 which are same, two 2 length substrings 00, 00 are same

1 for the original string

36 - (1+2+1) = 32
+1

answer should be 32 only there are 3 0's so substring '0','0','00' should be excluded from 35.

@Deepanshu, there are 8 char. in string so total substring should be -

n(n+1)/2 + 1= 8.9/2 +1 =37

2 are trivial and there are 3 0's so number of total non trivial substring = 37-2-3=32.

+1

@Deepanshu

specify the link in your question.

i edited my answer with your requirement, may you check https://gateoverflow.in/216914/

0
thanku everyone : )

0 votes
1 answer
2
+1 vote
3 answers
4
0 votes
1 answer
5
0 votes
1 answer
6
0 votes
0 answers
7