He started from the very beginning. The first topic discussed was array. Markandey one of our batch mates had raised a problem on two dimension array, so, that was the first topic discussed there.
Next he moved to stack, queue and recursion. Almost everyone has some problem with recursion.
We do not have much problem with stack and queue, but when our MGPA question was asked on queue, I was not able to do it, though it was not a tough one.
Anyways, later he discussed link list and tree. He started with a quick recap of difference between a binary tree and BST. All the operations in a BST is not so tough as compared to deletion. Here is the process for deletion of tree.
Deletion in tree:
- Determine Node to be deleted is the left child(LC) or the right child(RC) of its parent.
- When leaf is to be deleted-First findnode which is to be deleted, then findparent, check LCorRC. Then delete it.
- When Node to be deleted has only one child-First findnode. then findparent, check LCorRC. Finally delete it by attaching LC (or RC which is not nul) to its parent.
While teaching he often asks the complexity of insertion and retrival of data in each and every data structure. So, I think by now every one has remembered the complexity of link list, queue, tree etc.
Sir always tries to make an interactive conversation with students.Earlier, I have never coded for data structure, but here at C-DAC I have learnt how to code for stack, queue, link-list and tree.

No comments:
Post a Comment