Skip to main content

Questions tagged [complexity]

Complexity deals with various forms of calculating the complexity of code. Cyclomatic complexity, n-path complexity, Big O time and space complexity.

4 votes
4 answers
2k views

I am reading Ousterhout's A Philosophy of Software Design. In Section 2.3, Outserhout writes: The signature of a method creates a dependency between the implementation of that method and the code ...
user3899725's user avatar
0 votes
1 answer
279 views

I recently changed my job to a big MNC and the code I am exposed to is highly complicated, difficult to read and understand. Although it is divided in microservices and runs on local I have to keep ...
Surya Saini's user avatar
1 vote
0 answers
147 views

I'm trying to solve the following problems here: In the X world, companies have a hierarchical structure to form a large binary tree network (can be assumed to be a perfect binary tree). Thus every ...
driver's user avatar
  • 111
2 votes
3 answers
332 views

Summary I saw a solution to a problem described as having O(c) Time complexity where c is the number of unique items in n. I don't understand why we can say the complexity is O(c) despite looping ...
3366784's user avatar
  • 131
-3 votes
3 answers
214 views

In the Netflix series Suits, Season 1, Episode 8 (Identity Crisis), the legal team, with the help of a hacker, is tasked with proving that a business magnate embezzled funds, splitting them and ...
Cade Bryant's user avatar
0 votes
1 answer
134 views

Disclaimer: this is not an attempt at solving P vs NP, but a way for me to better understand the problem. Let ¥(n) be the Subset sum problem, n being the number of inputs. Trivially, a brute force ...
Frax's user avatar
  • 103
0 votes
0 answers
96 views

So I came upon this time complexity result and I was confused about it, it said that : O(nlogn) + O(logn) =O(log(n+1)) Why is that the case? Shouldn't the result be O(nlogn)?
blake 's user avatar
  • 27
0 votes
2 answers
395 views

In Daily Coding Problem, Miller&Wu have the following problem : Given an array of integers, return a new array where each element in the new array is number of smaller elements to the right of ...
molyss's user avatar
  • 181
0 votes
3 answers
731 views

Prompted by Sonar, I am looking to reduce the complexity of a function (one that some might call arrow code). I am loosely familiar with some of the principles of reducing arrow code complexity (...
j.k's user avatar
  • 111
-1 votes
1 answer
270 views

I have a two dimensional data with one dimension is ordered and another one is categorical, for example, country and city_age: country age city Italy 2773 Rome Germany 784 Berlin USA 397 New York ...
Dims's user avatar
  • 157
14 votes
3 answers
5k views

I recently asked a question on CodeReview SE where using a binary search was recommended, and the author of the answer proved that it was faster than my implementation. During my research on the topic,...
Taco's user avatar
  • 1,175
4 votes
1 answer
1k views

Mostly in all routers and operating systems the Longest Prefix Match algorithm is used for searching the trie of IPv4 addresses. Packet filters like Iptables don't need some special data structure for ...
red0ct's user avatar
  • 99
0 votes
2 answers
1k views

I am trying to calculate the time complexity of the below code snippet def func() { for(i=1; i<=n; i++) { for(j=1; j<=n; j=j+i) { print("hello") } }...
learnToCode's user avatar
3 votes
0 answers
571 views

I'm working on a application which uses event-sourcing and CQRS to define it's domain model. Background We have implemented projections to aggregate stream of all domain events into a read models used ...
Euphoric's user avatar
  • 38.2k
4 votes
5 answers
421 views

I have a disagreement with one of my colleagues on whether or not functions should have inverse functions available. I would like to know when/if inverse functions should be used. For example, say we ...
Byebye's user avatar
  • 346

15 30 50 per page
1
2 3 4 5
15