If this blog helped you in any way, please donate a dollar here

Showing posts with label Algorithm. Show all posts
Showing posts with label Algorithm. Show all posts

Saturday, November 26, 2011

Genetic Algorithms

I have been busy for the past few months and it reflects on the time it took to bring out another post on my very beloved blog. Since getting admitted to post-graduate studies I have been fascinated by non-deterministic algorithms that are used to solve NP hard problems with reasonable accuracy. The branch of study I am referring to is known as "Soft-Computing".

There are various such algorithms that are based on the natural actions or inspired from nature. Some examples are Genetic Algorithms, Artificial Neural Networks, Fuzzy Logic, et cetera. What is so fascinating about this branch is that non-determinism and confusion are the concepts that determine the solution! When I say determine the solution I never mean to imply it finds out the exact solution always, it does not. These computations will find out the approximate results that are good enough for humans to understand and apply.

Let me try to elaborate each of these wonderful concepts to the best I can. In this part I shall be elaborating on Genetic algorithms.

Monday, August 8, 2011

Iterative Inorder Traversal of Binary Search Tree

A student from my undergrad college asked an innocent question to me on a facebook group to write an iterative implementation for In-Order Traversal of a Binary Search Tree. Of course I obliged and wrote up a code. However, I had never dug deeper into the properties of such traversals before and my observation was quite unexpected.

I was asked a question in the M.Tech. programme interview at NIT Durgapur about the significance of In-Order traversals of BSTs. I wasn't aware of any! So I gave a prompt reply, that it prints the elements in a sorted order. I was sure I was correct but the expression on their faces led me believing I was surely wrong! Oh well, I never did study theory before, so I guess my anguish was justified.

So, for my fellow junior, here's the code I promised:

Tuesday, February 9, 2010

Palindrome Formation problem

Recently in the BESU tech fest, the final round of programming event contained a series of interesting questions.

Even though I was unlucky enough to not win a prize (after making some kiddish mistakes), I happen to have discovered something of a problem that read: