Skip to content

Latest commit

 

History

History
35 lines (20 loc) · 577 Bytes

File metadata and controls

35 lines (20 loc) · 577 Bytes
title Algorithm4 Java Solution 1.4.06
date 2019-08-06 15:54:00 +0800
draft false
tags
JAVA
categories
TECH
archives

1.4.06

Problem:

Give the order of growth (as a function of N ) of the running times of each of the following code fragments

2019-08-14-007

2019-08-14-008

Solution:

a $N+N/2+N/4+...=~2N$ linear

b $1+2+4+8+...+N = ~2N$ linear

c $N(1+1+1+...+1) = ~NlgN$ linearithmic

Reference: