Skip to main content

All Questions

Tagged with
2 votes
2 answers
562 views

Is this architecture overkill? What is a good way to architect this software?

I have an algorithm I am trying to implement that has steps 1 to 5. There are several different ways I could implement each step. Each calculation step is essentially just an astronomy calculation, ...
Hunter's user avatar
  • 187
-1 votes
4 answers
532 views

Leetcode: 2327. Number of People Aware of a Secret and Problem with programming skill in general

On day 1, one person discovers a secret. You are given an integer delay, which means that each person will share the secret with a new person every day, starting from delay days after discovering the ...
jason's user avatar
  • 15
1 vote
2 answers
182 views

Dependency resolution of tasks which have crontab information

I want to illustrate my problem statement with a use case. I am building a trading system that acts as a container for deploying trading strategies. The trading strategy comprises dependent tasks. Let'...
m0hithreddy's user avatar
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
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
-2 votes
2 answers
5k views

Is using nested try-except blocks problematic?

I've been seeing a lot of this construct throughout my application: def doSomething(): try: # setup some variables try: # do something that could throw an OSError ...
pstatix's user avatar
  • 1,047
5 votes
4 answers
641 views

Processing a 2D matrix - need to speed up my O(n^4) algorithm

I have an n x n matrix which I need to convert into a list sorted by value. Starting with the maximum value cell at (row x1, col y1), I must immediately exclude all cells where (x >= x1, y <= y1)...
Irfan434's user avatar
  • 187
3 votes
4 answers
8k views

Check distance between all elements in a list of numbers in O(n*lg(n))

I have an exercise for my algorithms and data structures class, where I basically have to implement a divide and conquer algorithm or function called check_distance to determine whether all numbers in ...
user avatar
-4 votes
1 answer
1k views

Better way to process huge files

I have a huge csv file and I have to process that file and do some data manipulation. Right now I'm reading/loading the file in buffer and then doing the data processing work. I find this approach ...
ilaunchpad's user avatar
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
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
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
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
2 votes
5 answers
2k views

Detect frequency pattern in a list of dates

I have a list of dates in which a certain event happened. Taking into consideration that a particular occurrence of the event can: Be a one time thing or Be part of a periodic series, which happens ...
user2891462's user avatar
-1 votes
1 answer
96 views

How would I detect a physical attack in video form? [closed]

I hope this question isn't too vague because it's more a discussion than a question. I want to write a code which can detect physical violence in a scene (with the end result being the prediction of ...
Eve Pitt's user avatar

15 30 50 per page
1
2 3 4 5