computer-science-theory

Subtle nuances of Big O notation for computation complexity

二次信任 提交于 2021-02-11 07:08:55
问题 I was just working on a LeetCode problem, Roman to Integer, the conversion of Roman numerals to integers, and after finishing up and comparing solutions, I noticed a rather interesting nuance in how the solutions listed describe their computational complexity. I had described my solution as O(n) , linear with the number of input elements, as my solution iterated over the elements of a Roman numeral character by character. The official solutions, however, described how with numerals I , V , X

Computational complexity for the case of many answers or multiple parameters

淺唱寂寞╮ 提交于 2019-12-23 04:46:12
问题 How is computational complexity defined if the algorithm: ...yields many results? As a total (then an algorithm producing a set of k cannot be faster than O(k) ) or per element (then the estimate must be multiplied to compare it with non-set-producing algorithms)? What about storage complexity - does an estimate reflect if the entire set needs to be present in memory at once or each consecutive element can be produced and discarded? ...has multiple parameters? A separate figure for each

Getting started with the sport of competitive programming [closed]

青春壹個敷衍的年華 提交于 2019-12-05 08:14:42
问题 Closed . This question is opinion-based. It is not currently accepting answers. Want to improve this question? Update the question so it can be answered with facts and citations by editing this post. Closed 2 years ago . How do you get started with competitive programming and get well versed with various topics in it ? What all things you can do ? Get started directly or do some concepts first. 回答1: This is a very popular question on Quora, but is generally considered off-topic for Stack

Getting started with the sport of competitive programming [closed]

社会主义新天地 提交于 2019-12-03 21:59:54
How do you get started with competitive programming and get well versed with various topics in it ? What all things you can do ? Get started directly or do some concepts first. This is a very popular question on Quora, but is generally considered off-topic for Stack Overflow. The best way to use SO for competitive programming advice is to ask specific questions about problems you're having when coding a solution. For example, you might ask how a language feature works. Often you'll find that the question has already been asked. Here are the 108+ Quora answers to your question: https://www