Subject: Reverse of String

Assalamualikum Dear Sir... Hope u r fine... My Question is that In Reverse String we write letters from backward like babdb  rev(s)= bdbab   But i am confuse from this Example 

Sigma = {B , a, bab, d}

S= BaBbabBd

Rev(s)= dBbabaBB

Plz kindly clear my confusion why the Centeral Alphabets are not changed. 

Regards Robina

Post Your Comments
Other Students' Comments: 0

Instructor's Reply:

Dear Student,

 

Yes, you are right. In the reverse of a string, the letters of that string are written in opposite order. For example, if we have a string Bbabda defined over Sigma = {B , a, bab, d}, we can write its reverse as adbabB. Just remember that bab is a single letter in the given alphabet and not three letters so it will be treated as a single entity while finding the reverse of the string.

 

Note: The example, you have given is not correct for the given alphabet. In this example b is not a letter but you have included it in the string.

Knowledge 2016-07-20View: 912

Categories: Knowledge

Comments

Leave a comment