GATE 1998
December 6, 2023GATE 1998
December 6, 2023GATE 1998
| Question 23 |
How many sub strings of different lengths (non-zero) can be found formed from a character string of length n?
| n | |
| n2 | |
| 2n | |
![]() |
Question 23 Explanation:
Let us consider an example S = {APB}
Possible sub-strings are = {A, P, B, AP, PB, BA, APB}
Go through the options.
Option D:
n(n+1)/2 = 3(3+1)/2 = 6
Possible sub-strings are = {A, P, B, AP, PB, BA, APB}
Go through the options.
Option D:
n(n+1)/2 = 3(3+1)/2 = 6
Correct Answer: D
Question 23 Explanation:
Let us consider an example S = {APB}
Possible sub-strings are = {A, P, B, AP, PB, BA, APB}
Go through the options.
Option D:
n(n+1)/2 = 3(3+1)/2 = 6
Possible sub-strings are = {A, P, B, AP, PB, BA, APB}
Go through the options.
Option D:
n(n+1)/2 = 3(3+1)/2 = 6

