Can any give me algorithm for online railway reservation system?

Google is your friend. We don't give answers to school problems. If this isn't a school problem I'd still tell you to do a Google search. There are relevant articles on the Wikipedia, but in any case, you first need to understand reservation systems themselves: http://en.wikipedia.org/wiki/Computer_reservations_system

The above link is for airline reservation systems primarily, but the principles are the same.

Make google your friend, partner...

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.