Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

5) (50 points) Arrange numbers in an equilateral triangle with n numbers at the base, like the one shown below for n - 4. The

image text in transcribed

image text in transcribed

5) (50 points) Arrange numbers in an equilateral triangle with n numbers at the base, like the one shown below for n - 4. The problem is to find the smallest sum in a descent from the triangle's apex to its base through a sequence of adjacent numbers. 2 4 7 8 6 6 (Note that 4 in the second row has two adjacent numbers in the third row: 3 and 7, but not 1.) Thus, for the triangle above the minimal sum is 2+516 14. Store the elements of the triangle in an arrayA [i,. indexed top-to-bottom by rows 1-1, , n and left-to-right by columns j : 1, , 1. a) What is the size of the triangle as a function of n? In the above example, the size is 10. What is the relationship between adjacent elements of the triangle in terms of i and j? In the example above, the item 4-A[2 2] is adjacent to the items 3-A32and-A33 below it write your answer in the form "A [i, is adjacent to elements AL J and AL J below, for i

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Guide To Client Server Databases

Authors: Joe Salemi

2nd Edition

1562763105, 978-1562763107

More Books

Students also viewed these Databases questions