问题描述
开始研究O表示法并坚持使用此示例。
let input = 'someText'
let parsedText = (() => { try { return JSON.parse(input) } catch { return {} }}).call()
console.info(parsedText) // {}
input = '{ "hello": "world" }'
parsedText = (() => { try { return JSON.parse(input) } catch { return {} }}).call()
console.info(parsedText) // { hello: 'world' }
input = '9'
parsedText = (() => { try { return JSON.parse(input) } catch { return {} }}).call()
console.info(parsedText) // 9
def除以I算为O(log n)+ O(1)= O(logn) 范围(2,number // 2)中的因子:n / 2 = O(n)* O(logn)= O(nlog)
最坏情况:O(nlog) 最佳情况:O(登录)
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)