Challenge for all programmers.
Language: Python.
Display the given pattern.
1
11
101
1001
10001
Restrictions:
• Don't use any conditional constructs.
Share
Challenge for all programmers.
Language: Python.
Display the given pattern.
1
11
101
1001
10001
Restrictions:
• Don't use any conditional constructs.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Answer:
Program to print modified Binary triangle pattern
Given an integer N, the task is to print the modified binary tree pattern.
In Modified Binary Triangle Pattern, the first and last element of a Nth row are 1 and the middle (N – 2) elements are 0.
Examples:
Input: N = 6
Output:
1
11
101
1001
10001
100001
Input: N = 3
Output:
1
11
101