Master the basics of C++ programming in a fun and engaging way. Whether you're a complete beginner or have some programming experience, this course will help you develop the skills you need.
MIT License
3
stars
3
forks
source link
Adding a new program called " C++ program for pascal triangle" in the basic folder #1
Pascal’s triangle is a triangular array of the binomial coefficients. Write a function that takes an integer value n as input and prints first n lines of the Pascal’s triangle. Following are the first 6 rows of Pascal’s Triangle.
1
1 1
1 2 1
1 3 3 1
1 4 6 4 1
1 5 10 10 5 1
Time Complexity : O(n^2) and space complexity : O(n^2)
Pascal’s triangle is a triangular array of the binomial coefficients. Write a function that takes an integer value n as input and prints first n lines of the Pascal’s triangle. Following are the first 6 rows of Pascal’s Triangle.
1
1 1 1 2 1 1 3 3 1 1 4 6 4 1 1 5 10 10 5 1
Time Complexity : O(n^2) and space complexity : O(n^2)