Function t(k) 1. If k=1 then   1.1 t ← 3   else     1.2 t ← t(k-1)+k If you call z←t(4) in a main program, what is the value of z ?

Elements Of Modern Algebra
8th Edition
ISBN:9781285463230
Author:Gilbert, Linda, Jimmie
Publisher:Gilbert, Linda, Jimmie
Chapter8: Polynomials
Section8.2: Divisibility And Greatest Common Divisor
Problem 31E
icon
Related questions
Question

Consider the following function algorithm.

Function t(k)

1. If k=1 then

  1.1 t ← 3

  else 

   1.2 t ← t(k-1)+k

If you call z←t(4) in a main program, what is the value of z ?

Expert Solution
steps

Step by step

Solved in 2 steps

Blurred answer
Knowledge Booster
Complexity
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, algebra and related others by exploring similar questions and additional content below.
Recommended textbooks for you
Elements Of Modern Algebra
Elements Of Modern Algebra
Algebra
ISBN:
9781285463230
Author:
Gilbert, Linda, Jimmie
Publisher:
Cengage Learning,
Algebra & Trigonometry with Analytic Geometry
Algebra & Trigonometry with Analytic Geometry
Algebra
ISBN:
9781133382119
Author:
Swokowski
Publisher:
Cengage
Linear Algebra: A Modern Introduction
Linear Algebra: A Modern Introduction
Algebra
ISBN:
9781285463247
Author:
David Poole
Publisher:
Cengage Learning