How to detect two moving shapes overlapped?
Given a list of circles with its coordinates (x and y) that are moving every second in different direction (South-East, South-West, North-East and North-West), and the circle will change direction if it hits the wall sort of like bouncing, so how do we detect if any of them collide or overlap with each other ? I am not sure if we can use some data structures like a Binary Search Tree
because since all the coordinates vary every seconds, so the tree will have to re-build accordingly. Or can we use Vertical Sweep Line Algorithm each time ? Any ideas on how to do this in a efficient way ?
When to use DAG (Directed Acyclic Graph) in programming?
I recently found a framework named ecto.
Quickly compute added and removed lines
I’m trying to compare two text files. I want to compute how many lines were added and removed. Basically what git diff --stat
is doing. Bonus points for not having to store the entire file contents in memory.
Equal Gifts Algorithm Problem
Problem Link – http://opc.iarcs.org.in/index.php/problems/EQGIFTS
Is there a way to add unique items to an array without doing a ton of comparisons?
Please bare with me, I want this to be as language agnostic as possible becuase of the languages I am working with (One of which is a language called PowerOn). However, most languanges support for loops and arrays.
Data structure for pattern matching
Let’s say you have an input file with many entries like these:
When modeling a virtual circuit board, what is the best design pattern to check for cycles?
To make it simple assume you have only AND and OR gates. Each has two inputs and one output. The output of two inputs can be used as an input for the next gate For example:
Filling array with numbers from given range so that sum of adjacent numbers is square number
Problem: Fill all the cells using distinct numbers from <1,25> set, so that sum of two adjacent cells is a square number.
Is it possible (and practical) to search a string for arbitrary-length repeating patterns?
I’ve recently developed a huge interest in cryptography, and I’m exploring some of the weaknesses of ECB-mode block ciphers. A common attack scenario involves encrypted cookies, whose fields can be represented as (relatively) short hex strings.
Grid Game Algorithm
Problem Link – http://www.iarcs.org.in/inoi/2009/zco2009/zco2009-1a.php