VOOZH about

URL: https://www.geeksforgeeks.org/dsa/program-for-triangular-patterns-of-alphabets/

⇱ Program for triangular patterns of alphabets - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

Program for triangular patterns of alphabets

Last Updated : 17 Feb, 2023

Pattern printing has always been an interesting topic in programming languages. It emphasizes the usage of inner and outer loops in nested loops and creates beautiful patterns from them. 
Below are given some patterns using alphabets. Our task is to write programs for the below-given patterns, such that each pattern should print on the basis of given input 'n' when n = count of alphabets.



Output
A B C D E 
B C D E 
C D E 
D E 
E 

Time complexity: O(n*n), where N is the number of alphabets.

Auxiliary Space: O(1), as constant extra space is required.



Output
E E E E E 
D D D D 
C C C 
B B 
A 

Time complexity: O(n*n), where N is the number of alphabets.
Auxiliary Space: O(1), as constant extra space is required.



Output
A 
A B 
A B C 
A B C D 
A B C D E 

Time complexity: O(n*n), where N is the number of alphabets.
Auxiliary Space: O(1), as constant extra space is required.



Output
E 
D E 
C D E 
B C D E 
A B C D E 

Time complexity: O(n*n), where N is the number of alphabets.
Auxiliary Space: O(1), as constant extra space is required.



Output
A A A A A 
B B B B 
C C C 
D D 
E 

Time complexity: O(n*n), where N is the number of alphabets.
Auxiliary Space: O(1), as constant extra space is required.



Output
A 
B A 
C B A 
D C B A 
E D C B A 

Time complexity: O(n*n), where N is the number of alphabets.
Auxiliary Space: O(1), as constant extra space is required.

Comment