Sunday, May 20, 2012

MS 3rd Sem Results

In the earlier blog about the 3rd semester, I had mentioned about waiting for the grade of one more subject. Finally, the results have come.


 ===============================================================================
 SNo.Course No.  Course Title                  EC-1  EC-2  EC-3  Total   Final
                                               (10%)(30%)(60%)  (100%)  Grade
 ===============================================================================
 1. BITS  ZG659 TECHNICAL COMMUNICATION        9.50 18.00  45.50   73.00   A- 
 2. SS    ZG515 DATA WAREHOUSING               8.00 18.00  39.00   65.00   B- 
 3. IS    ZC424 SOFTWARE FOR EMBEDDED SYSTEMS  7.00 11.50  34.50   53.00   A- 
 4. EEE   ZG512 EMBEDDED SYSTEM DESIGN         9.33 13.50  35.00   57.83   B- 
 ===============================================================================
 Current  CGPA :    7.71





Yes, I have completed 3 semesters. One last semester to go. Cant wait for it to happen! 



Monday, May 14, 2012

Largest rectangle ( area ) in the given Histogram

Problem :

Given an array of non-negative integers. Construct a histogram using array indices as height.

Assume the width as 1 unit. Find the rectangle with maximum area. Try to come up with an optimal solution.

Solution :

This problem can be solved in O(n) time, by comparing the prev and the current elements.

Here is the solution for the same.


MS - Software Systems - 3rd Semester

Finally, I am done with my 3rd semester exams. Though I am blogging a bit late about it, better late than never. With the interest of studying the subjects which I have never before, I opted for Embedded Systems Design and Software for Embedded Systems along with the Data Warehouse and Technical Communication.

The initial days were very difficult. I was finding it hard to manage work and the course. But over a period of 4 lectures, I had a hold of it. The mid-sem went fairy well. After one month, the final sem exams arrived. Had brushed through the concepts well and the open book exams were mostly design oriented for Embedded System design and Software for embedded systems.

I have obtained the results of 3 subjects.

In dataWarehouse I have scored 73 on 100, embedded System design, 57 on 100 and 75 on 100 in technical Communication. I am waiting for the last subject result. As soon as I get it, I will be updating the blog.

To all my batch mates, Wish you all the best! 

Design and Code : TicTacToe Game

Problem :

Design and code the TicTacToe game. Take care of all corner cases. The program should be extensible and very modular.

Solution :

This is a trivial game. We just need to take care of the vertical, horizontal and diagonal strikes, after each move. If there is any, then the game ends. After all moves, if there are no strikes, then the game is drawn.

The complete source code is available here

DutchNationalFlagProblem


Problem :

Given an array consisting of 0's 1's 2's ( Red, Blue and Green ). Come up with an approach where in array is rearranged such that, all 0's appear first followed by 1's and then 2's.

Solution :

This is equivalent to the partitioning having pivot element as 1. All elements less than 1( which is 0) will appear on the left hand side and all elements >1 are appearing on the right hand side. ( 2)

Here is the attached code for the same.