Skip to main content

All Questions

Tagged with
37 votes
9 answers
9k views

Is the algorithm more important than the programming language?

During the current (2013) Google Code Jam contest, there was a problem that took C++ and Java people 200+ lines of code as compared to Python people that solved the same problem only using 40 lines of ...
superspacemarines's user avatar
22 votes
9 answers
19k views

Is it essential to learn algorithms to be a real programmer? [closed]

I'm a PHP programmer, and until now I have not needed to learn algorithms... Now I'm start learning Python (a real programming language), because I need to use matplotlib. Does it make sense to start ...
André's user avatar
  • 333
21 votes
3 answers
881 views

How do I express subtle relationships in my data?

"A" is related to "B" and "C". How do I show that "B" and "C" might, by this context, be related as well? Example: Here are a few headlines about a recent Broadway play: David Mamet's Glengarry ...
Chuck H's user avatar
  • 321
18 votes
5 answers
11k views

Algorithm for flattening overlapping ranges

I am looking for a nice way of flattening (splitting) a list of potentially-overlapping numeric ranges. The problem is very similar to that of this question: Fastest way to split overlapping date ...
Jollywatt's user avatar
  • 321
16 votes
10 answers
9k views

Preferring Python over C for Algorithmic Programming

I've been studying a bit of algorithms and have been looking at sites like SPOJ.pl TopCoder etc. I've seen that programmers prefer C or C++ usually for most algorithmic programming contests. Now I'...
ffledgling's user avatar
11 votes
2 answers
538 views

How to select a most probable option from the list based on user text Input

I am working over a OCR Application where I need to select a option based on user text input. Ex: Available Options: ["python", "ruby", "java", "clojure", "haskell"] Input: kava Output: java Input: ...
Shiv Deepak's user avatar
9 votes
1 answer
8k views

How are queues made thread-safe in Python

I admit this was asked to me in interview a long time ago, but I never bothered to check it. The question was simple, how does Python make Queue thread-safe? My answer was, because of Interpreter ...
Harsh Gupta's user avatar
8 votes
7 answers
4k views

What would be an appropriate algorithm to factorise numbers in the range of a few billion?

I'm learning Python at the moment and to give me reasons to apply what i'm learning I'm having a crack at some of the problems on Project Euler I'm currently on number 3, which is to determine the ...
Chris's user avatar
  • 183
8 votes
5 answers
4k views

Chess: Efficiently deciding whether a check mate has been made

This question addresses building a Chess engine. I've done just that, and in my humble opinion quite elegantly. But I'm missing my ending conditions. Here are some pseudopython functions that I use. ...
Felix's user avatar
  • 387
7 votes
4 answers
2k views

Why do textbooks use pseudocode rather than real languages?

In colleges and in algorithm textbooks, it is quite common for the teacher and author to explain control flow in pseudo-code. With the advent of more expressive languages like Python and Haskell among ...
Asterisk's user avatar
  • 353
7 votes
2 answers
2k views

Advanced Job Shop Scheduling Algorithm Question

I've looked into numerous solutions for the simple version of this problem, but I've found no solutions for advanced cases, short of sorting through all possible permutations. I don't know where to ...
dvdnnn's user avatar
  • 79
6 votes
3 answers
7k views

Parsing scripts that use curly braces

To get an idea of what I'm doing, I am writing a python parser that will parse directx .x text files. The problem I have deals with how the files are formatted. Although I'm writing it in python, I'm ...
MxLDevs's user avatar
  • 789
6 votes
1 answer
253 views

Algorithms to Determine How Much A Factor Contributes to A Total Value

Lets say that I have hundreds/thousands of objects(entries) in a database and each object contains 10 attributes. I have a way to quantitatively measure each attribute where a higher number implies ...
user1431282's user avatar
6 votes
2 answers
5k views

Scheduling: balanced home/away round-robin tournament algorithm

I am trying to achieve a round-robin algorithm for sports scheduling that also guarantees a fair or balanced home/away rotation. I based my algorithm on the round-robin scheduling algorithm: def ...
dabadaba's user avatar
  • 2,266
6 votes
1 answer
5k views

Python rectangle packing

I'm working on a project which involves packing multiple rectangles in a larger rectangle(the bounding box). Rectangles can't overlap with each other or with the boundaries of the bounding box. ...
Koen's user avatar
  • 69

15 30 50 per page
1
2 3 4 5