Question: Write a recursive java method that receives a reference to the root of a binary tree that contains characters ( upper and lowercase letters from
Write a recursive java method that receives a reference to the root of a binary tree that contains characters upper and lowercase letters from the English alphabet, digits, and special characters and then prints and returns the count of all valid passwords constructed from the values in the nodes of the tree when traversed in a pretorder traversal.
Important notes:
A password is valid if it is of at least characters of length and contains at least one lowercase letter, and one uppercase letter, two digits and one of the following special characters @ $ and &
Characters of the password must be in the order they appear when the tree is traversed in a pretorder traversal.
Your method must find the result with minimum time.
You cannot use any other data structure array arraylist, linked list, set, stack, queue, etc. are all not allowed
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
