Homework Statement
Compute the time complexity of the following sorting algorithm on an array L[0..n-1] in terms of n. Basic Operation only includes comparison and swap.
sort (L, n)
{
int i=0, j;
while(i<n-1){
s = i ;
j=i+1...
Homework Statement
Evaluate: Sum[k2-k+1/k(k-1),{k,2,infinity}]Homework Equations
The Attempt at a Solution
k2-k+1/k(k-1) can be written as k/(k-1) - 1/k, but then I get stuck because when n->infinity, the sum is divergent.
Object: Write a program that read digits and composes them into integers. For example, when you read 123( in characters) the program should print: "123(in integers) is 1 hundred and 2 tens and 3 ones".
My first attempt is first read the number as a string then convert its characters to...
Honestly I do not know how to sum x^k/(4^k), can you explain a little more why we have to put it in a function f(x)? f'(x) at x=1 going to be (k-ln4)/(4^k) but then ?
Homework Statement
Evaluate: 1/4+2/16+3/64+4/256+5/1024+...
Homework Equations
The Attempt at a Solution
The summation can be written as: Sum(k=1 to infinity, k/(4^k))
Then I do not know how to calculate the sum. Please help!