How many possible passwords are there, given the following restrictions:
Must be between 4 and 6 characters long
Must begin with ‘A’
May only contain letters (uppercase or lowercase) and digits
(6-4) * (26*2 + 10) |
||
(26*2 + 10)3 + (26*2 + 10)4 + (26*2 + 10)5 |
||
(26*2 + 10)4 + (26*2 + 10)5 + (26*2 + 10)6 |
||
(26*2 + 10)(6-4) |
Which is true?
Recursive algorithms are sometimes simpler than non-recursive algorithms |
||
Recursive algorithms are more efficient than non-recursive algorithms |
||
Recursive algorithms can only have one base case |
||
Recursive algorithms can only have one recursive case |
1)Password contain both upper and lowe case letters =>26*2 and also contain digits =>10.
Password must be contain 4-6 digits and also given password must always starts from A.So we have length of 3-5.
So password =(26*2+10)*(3+4+5).
Answer is
(26*2 + 10)3 + (26*2 + 10)4+ (26*2 + 10)5
2)Answer is Recursive algorithms are sometimes simpler than non-recursive algorithms.
Recursive algorithms can have more than one base case and can have more than recursive case so option 3&4 are wrong.
Recursive algorithms are not effecient than non recursive algorithms.so option 2 is wrong
Get Answers For Free
Most questions answered within 1 hours.