Questions tagged [language-agnostic]

Use this tag for PROGRAMMING QUESTIONS that are independent of any particular programming language.

Questions that are independent of programming language. These questions are typically more abstract than other categories.


A typical usage scenario with this tag is that you have a problem and you don't know how to solve much less what to write in a specific programming language.

So you would first ask a how type question with the tag and usually . Then when you get an acceptable answer you would code it in a specific programming language. If you have problems then you can refer back to the related question with the tag then in the new what question add the specific programming language, e.g. ,


Free Language Agnostic Programming Books


References:

Dictionary of Algorithms and Data Structures (NIST)

8332 questions
11
votes
1 answer

What is the difference between Cyclomatic Complexity and Essential Cyclomatic Complexity?

There has already been a question on What is Cyclomatic Complexity? However, there is another term called - Essential Cyclomatic Complexity. What are the differences and similarities between these two metrics of the code? What are their typical…
Jay
  • 1,210
  • 9
  • 28
  • 48
11
votes
4 answers

Good graph traversal algorithm

Abstract problem : I have a graph of about 250,000 nodes and the average connectivity is around 10. Finding a node's connections is a long process (10 seconds lets say). Saving a node to the database also takes about 10 seconds. I can check if a…
Paul Tarjan
  • 48,968
  • 59
  • 172
  • 213
11
votes
7 answers

Is it possible to calculate median of a list of numbers better than O(n log n)?

I know that it is possible to calculate the mean of a list of numbers in O(n). But what about the median? Is there any better algorithm than sort (O(n log n)) and lookup middle element (or mean of two middle elements if an even number of items in…
Kip
  • 107,154
  • 87
  • 232
  • 265
11
votes
2 answers

Set breakpoint on variable value change

I'm just wondering if is it possible to set breakpoint on change of variable value (in any programming language and tool) ? For example, I want to say: "Stop anywhere, when value of variable 'a' will be changed". I know that there is ability to set…
ceth
  • 44,198
  • 62
  • 180
  • 289
11
votes
3 answers

How to remove elements from a binary heap?

As I understand, binary heap does not support removing random elements. What if I need to remove random elements from a binary heap? Obviously, I can remove an element and re-arrange the entire heap in O(N). Can I do better?
Michael
  • 41,026
  • 70
  • 193
  • 341
11
votes
11 answers

Check if a string is rotation of another WITHOUT concatenating

There are 2 strings , how can we check if one is a rotated version of another ? For Example : hello --- lohel One simple solution is by concatenating first string with itself and checking if the other one is a substring of the concatenated version.…
h4ck3d
  • 6,134
  • 15
  • 51
  • 74
11
votes
5 answers

If the only difference between 32bit and 64bit CPUs is their register size then why must 32 bit programs be rewritten for a 64 bit platform?

What is the actual difference in terms of source code when writing a 64 bit program? For example is only the assembly different? It's not like there's a 64 bit version of C++. If it's something as simple as an option on the compiler than how come…
Celeritas
  • 14,489
  • 36
  • 113
  • 194
11
votes
9 answers

What is Code Coverage?

I have 3 questions : What is CodeCoverage ? What is it good for ? What tools are used for analyzing Code Coverage ?
n00ki3
  • 14,529
  • 18
  • 56
  • 65
11
votes
6 answers

Draw a equilateral triangle given the center

How do I draw an equilateral triangle given the center as cx and cy and the radius of the centroid circle ? And how do I find if a point is within the triangle or not ? PS: I am building this for android , but this question is language agnostic.
Gautam
  • 7,868
  • 12
  • 64
  • 105
11
votes
17 answers

Beyond simple coding: Where to go from here?

I've been coding since my early teenager years. I started out with HTML, went on to PHP/MySQL (created my own forums, social networking sites, etc..) and then branched out into more traditional languages such as Java and C++ (also picked up a…
mcFreid
  • 175
  • 1
  • 2
  • 8
11
votes
7 answers

What to do, if debug behaviour differs from normal execution?

I have a problem with debugging sessions. My program executes very well in a debug session but if I start a normal run, it behaves completely different. The problem is, that I cannot say, why it acts different. One possible reason is the slower…
guerda
  • 23,388
  • 27
  • 97
  • 146
11
votes
14 answers

How do you deal with your past programming atrocities?

None of us started off as experts (and most of us still aren't). Sure, we all knew how to write programs in our preferred languages, but writing quality applications and writing syntactically correct programs are two very different things. We…
Michael Moussa
  • 4,207
  • 5
  • 35
  • 53
11
votes
6 answers

Should a TDD test always fail first?

As a followon to the discussion in the comments of this answer, should a TDD test always be made fail first? Consider the following example. If I am writing an implementation of LinkedHashSet and one test tests that after inserting a duplicate, the…
Yishai
  • 90,445
  • 31
  • 189
  • 263
11
votes
1 answer

Determine RGBA colour received by combining two colours

I have two colours defined as RGBA (in my specific examples, one of the set is [white with alpha 0.85] and [57, 40, 28 with alpha 0.25]. The second colour is drawn over the first one (i.e. white with alpha is the background and the second colour is…
Aleks G
  • 56,435
  • 29
  • 168
  • 265
11
votes
8 answers

Map incrementing integer range to six-digit base 26 max, but unpredictably

I want to design a URL shortener for a particular use case and type of end-user that I have targetted. I have decided that I want the URLs to be stored internally according to an auto-incrementing integer key. However, it is also required that a key…
jamorison
1 2 3
99
100