Finding the pairs of intersecting discs
Ajit,

Essentially this is a problem of 1-dimensional collision detection.

A useful tool for that is spatial-partitioning.

The book "Real-Time Collision Detection" by Christer Ericson (Morgan-Kaufmann, 2005) contains a wealth of information.  See pages 300–307 for an excellent discussion of 1-dimensional spatial hashing and pages 316—318 describing Morton keys.  The code given there is in C++ but could easily be adapted to C.

You can view a sample by clicking on "Search Inside This Book" at Amazon and then searching for "Hierarchical Grids".  The 5th link or so is page 300.

—Todd