Answer 2
What is the computational complexity of your answer in Question 1? Can you explain why?
The computational complexity of Question 1 is O(n2).
Explanation:
for i in range(len(arr2)):
| {% for key, value in test_codes_dict.items %} | |
| <option value="{{ key }}">{{ value }}</option> | |
| {% endfor %} |
| <!DOCTYPE html> | |
| <html lang="en"> | |
| <head> | |
| <meta charset="utf-8" /> | |
| <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" /> | |
| <meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" name="viewport" /> | |
| <meta name="viewport" content="width=device-width" /> | |
| <title>ATE-Dashboard</title> |
| function createArrayOfFunctions(y){ | |
| var arr = []; | |
| x = 1 | |
| for (let i = 0; i < y ; i++){ | |
| arr[i] = function(x){ | |
| return x + i; | |
| } | |
| } | |
| return arr; |
| import time | |
| def recursiveFibonacci(number, fn1, fn2): | |
| fnNext = fn1 + fn2 | |
| fn1 = fn2 | |
| if number < fnNext: | |
| print(fnNext) | |
| else: | |
| recursiveFibonacci(number, fn1,fnNext) |
Answer 2
What is the computational complexity of your answer in Question 1? Can you explain why?
The computational complexity of Question 1 is O(n2).
Explanation:
for i in range(len(arr2)):
| def isSubset(arr1, arr2): | |
| count = 0 | |
| flagSubset = False | |
| for i in range(len(arr2)): | |
| for j in range(len(arr1)): | |
| if(arr2[i].strip().upper() == arr1[j].strip().upper()): | |
| count+=1 | |
| break | |
| curl -H 'Content-Type: application/json' -X POST http://localhost:5984/_replicate -d ' {"source": "http://localhost:5984/bec-ember-three/", "target": "http://128.199.160.40:5984/bec-ember-recover"}' | |
| curl -X POST http://128.199.160.40:5984/_replicate -H "Content-Type: application/json" -d '{"source": "test_database", "target":"bec-practice", "doc_ids": ["practices"]}' |