![]() |
VOOZH | about |
Time Complexity: O(N) where N is number of nodes in a given binary tree
Auxiliary Space: O(N)For the given input, this program prints the following pattern. The input must be an odd number.
Examples:
Input : 7 Output : ******* ** ** * * * * * * * * * * * ** ** *******
Below is the code printing above pattern :
Output :
******* ** ** * * * * * * * * * * * ** ** *******
Time Complexity: O(n2)
Auxiliary Space: O(1)
For given input, this program prints the following pattern. The input must be an odd number.
Examples :
Input : 9 Output : * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
Below is the code printing above pattern :
Output :
* * * * * * * * * * * * * * * * * * * * * * * * * * * * *
Time Complexity: O(n2)
Auxiliary Space: O(1)