Monday, October 8, 2007

The report until now........

It's sunday night and now I've developed the programs (on paper) for Graph including functions for adding a vertex, adding an edge, performing a breadth-first-traversal (bfs) and performing a depth-first-traversal (dfs). Initially, the program could make up for unwieghted directed graphs only, but now I've introduced another array to synchronously contain the weights of the edges..... and it should work fine as far as I can see till now........ I think a little addition will equip my code to deal with the undirected graphs also..... or might the already there code might be sufficient....... I still need to check and might be to modify it....... One thing really interesting happened........ Ravi and Subhash fortunately happened to visit my room and have a very exhaustive discussion over the working and correctness and also on what all could be added possibly to the code to enhance it....... I explained the internals and the working algorithm of my code to them and it was really enjoying....... I think this is the best method we all could apply to carry our code-development activity at a rapid pace........ because you know nobody in this place in willing to help in any way..... and each student is expected to develop such complex logics by himself and that even when the classes are not at all good enough to help us understand the concepts and get ourselves comfortable coding those concepts........ I have yet not been able to get a good cover on the B-Tree..... I've only coded the search function for the B-Tree; and the insert function and the delete function are still remaining....... and they are really tough stuff to code because insert function involves breaking nodes.................. while delete function requires joining nodes......... and these breakings and joinings are really tough as far as I see to it till now...... You need to see whether there is room for the new node to be inserted....., if yes do the insertion in the proper node without involving any breakings...... if not...... insert the node and find the median element in the node....... shift it one level up...... and break the node into two at the point of the median element........ and follow the same procedure way up to the root............................................... and do you why so much pain in implementing the B-Trees.......... because they grow not at the bottom like the Binary Search Tree (BST)..........................., but at the top.................. You can never create a leaf node in a B-Tree to insert a new value..... you simply insert the value in the appropriate place and if the node has more values than could be allowed......... travel the median value up the node and repeat the process untill you are over upto the root of the B-Tree....... For now, I've planned to code the rest of the algorithms on Graphs.............. and I am to start with them......Bye....

No comments: