Data Structure:
1. Write a program for f(n) = 1^2+2^3+…+n^2. (i^2 = i*i)
2. If you have the following polynomial function
f(n)=a0 +a1 x + a2x2+…+an xn ,
then you are asked to write a program for that, how do you
do?
3. Write a function in C++ to sort array A[]. (You can assume
that you have 10 elements in the array.)
4. Analyze the following program, tell us what does it do for
each location of “???” (...
(a) Find the limit of {(1/(n^(3/2)))-(3/n)+2} and use an
epsilon, N argument to show that this is indeed the correct
limit.
(b) Use an epsilon, N argument to show that {1/(n^(1/2))}
converges to 0.
(c) Let k be a positive integer. Use an epsilon, N argument to
show that {a/(n^(1/k))} converges to 0.
(d) Show that if {Xn} converges to x, then the sequence {Xn^3}
converges to x^3. This has to be an epsilon, N argument [Hint: Use
the difference...
Use Java for the following;
Part 1
n!= n * (n –1)* (n–2)* ...* 3 * 2 * 1
For example, 5! = 5 * 4 * 3 * 2 * 1 = 120
Write a function called factorial that takes as input an
integer. Your function should verify that the input is positive
(i.e. it is greater than 0). Then, it should compute the value of
the factorial using a for loop and return the value. In main,
display...
Define the following function f(n) =
5(2^n)-(2^(n-1)), n ≥
1. Write a recursive definition for the function f(n)?
Consider the following recurrence: an= 2an-1
+ 3 (where a1 = 1). Compute the values of an
for n ≤ 5. Find a solution for the recurrence definition and
validate its correctness.
Consider the following recurrence: an=2an-1
+an-1an-2 (where a1 = 1). Compute the values
of an for n ≤ 5.