Saved Bookmarks
| 1. |
Challenge for all programmers.Language: Python. Display the given pattern. 111101100110001Restrictions: • Don't use any conditional constructs. |
|
Answer» 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 |
|