Friday, February 18, 2011

Construct binary tree using Post-order and Pre-order Traversals

Is it possible to build a binary tree given only Post-order and Pre-order traversals of that tree?

Thursday, November 25, 2010

Silver lining from Bihar Elections

Politics has always interested me and I closely follow political developments. Many incidents stun me like how Vajpayee led NDA lost power or even how Congress managed to gain so much ground in last elections. Today's development has been equally surprising to me, Nitish Kumar reigning in with a land-slide win.
Most election results are quite understandable with elections being won by money, muscle power or cast/religion equation. This is a sad situation but this has been the way all along since educated people would hardly vote and the class of people who would vote, would easily fall for any of above. But, I guess with the advent of news channels slowly people are waking up to realty. They now at least can figure out the lesser evil. I think that is how you can explain even with adversaries of likes Lalu Prasad who in muscle power can fight naxals or Ram Vilas Paswan whose paper on cast/religion calculations can be considered a worthy study in advance mathematics or prince charming Rahul biting the dust against Nitish Kumar.
I believe media in general has played a huge role in making people aware of faces behind the masks. For me there definitely is a silver-lining in Bihar's election results that voter today isn't as blind as it used to be 15-20yrs back and although slowly it is making the right choices but still a long way to go.

Saturday, September 11, 2010

Top 10 activities people do at onsite

I have been onsite for short duration on couple of occasions to US and currently in Sweden. When I was travelling for the first time a colleague asked me what would be the first thing you would do after reaching there, I immidiately replied change location on Orkut. :-) But, Dhruv who was also supposed to accompany me and had more wild plans as in absconding to avoid deportation, running around on beaches etc. none of which materialised though.
In past few years, I have seen many people who have traveled for work and things they do. All things are basically dictated by the Golden rule, 1$ is equivalent to 40odd INR. With this thing mind as solid as anything, many people do stupid things like skipping meals, gorging on free food available in office, spending time in lousy rooms rather than exploring places and culture around or even not making the effort to lead a normal life with basic necessities covered. So what is it that people actually do, let's take a sneak-peek,

10. Work. Well that is the reason people are onsite, so got to be on the list.
9. Eat out. Food in restaurant is generally expensive plus tip is mandatory, converting the sum into INR would fetch ten extra dinners back home, so such luxuries are rare.
8. Travel around. For most, it's the fear that if you went back without visiting few places, bragging would get difficult or you might just be pulled up, so with cheapest possible deals, such journeys take place.
7. Cook and clean. With less probability of eating out and Mom not around, cooking and cleaning is something that one has to be burdened with. Effect of which is, if you are cooking once, make sure you cover at least 2-3 meals.
6. Watch English movies and serials, once the popular stock is exhausted take up classy Bollywood ones, when that's done with go for Marathi, Mallu, Tamil, Korean, Irani and Japanese ones. Piracy Iindabad, long live torrent. Aha, finally something that's free or almost free.
5. Keep pushing updates on FB by way of changing status messages, comments and Likes, watching videos on FB and YouTube. With so much time to pass and very few things to do for free of cost, this is probably one of the best ROI activity.
4. If phone is available for free, call up each and every fellow back home including those whom you have not talked in years. If phone isn't free, still call but keep the talk short.
3. Start practicing the foreign accent in your speech.
2. Check the currency conversion rate and calculate how much money would be saved. Something that brings a instant smile :-)
1. Click photos of all possible places, from all angles, in different camera-modes, in all clothes, of-course with and without sunglasses, finally just to make sure photo is perfect, click a back-up too. Gather all the photos and upload them to internet. I just wonder the amount of hard-disk space, internet bandwidth and server-space would have been eaten up by in all this.

India-mania

Okay so bunch of foreigners visit your town for their official purpose, how big a deal is it? Well not much, heck who gives a damn. But, if you are twelve Indians and you are in north Sweden's city, you might have caused stir.

Yeah, couple of journalists took our photos at work and one of them actually publishing our article on internet too. I guess, what called for immediate attention towards us was our very strange for them food requests in restaurants (pure Vegetarian). Whatever, I am not thinking about it, I am on cloud nine with this publicity, my photo is weired but I do not care for that too, what matters is I AM THERE :-). The link to original post is here and I am pasting snippet below

Explizit lägger ut jobb till Indien



Magnus Andersson, Explizit, och Mikael Peiper, Tieto, instruerar de indiska programmerarna i deras arbete.

Explizit från Skellefteå knyter tolv utvecklare från Indien till ett treårigt projekt. En vågad satsning kan tyckas, men Arne Viktorsson, vd, menar att man nu blir starkare konkurrensmässigt samtidigt som man pressar kostnaderna.

I ett samarbete med Tieto har it-företaget Explizit ett mycket stort projekt på gång. Affären innebär att man knyter kontakt med tolv indiska utvecklare som kommer att jobba med utveckling av produkten i tre år.

Tuesday, August 31, 2010

The Skellefteå days

I have been Skellefteå for over two weeks now and in the short duration I have already witnessed the good and bad of its weather. Good being 20C, sunny, cool breeze coming from Skellefteå river and bad being overcast, rainy and damp. It is a small city with city-center, picturesque landscapes and woods all in close vicinity. When you come from India, a place buzzing with gazillions of people, lot of garbage dumped everywhere and to click a photo with beautiful surrounding most of the times one would need to travel few miles at least but the western world with its cleanliness, neatness and planned roads overwhelms you, at times so much so that you open the door and it makes you wanna click photos.
We have been put up in a place called Stiftsgården in a shared accommodation, can't be called a lavish arrangement but we have adjusted well. The place has some history associated with it, one of its buildings is the oldest construction in city and it is in middle of complex belonging to city's biggest church and graveyard. It is not far from my work-place and city center, makes it easy to cycle to both places every day. The conditions have been suiting well to me with cycling adding the zing to daily routine. We are in all a group of eleven people here and all of same age-group so helped in connecting well. In the two weeks, we have been to a beach, a lake and hiked to a rocky mountain top apart from daily explorations on the bike.
This is end of summer here in North Sweden, so people are in general celebration mood, they have had their vacations, been to beaches and charged themselves enough under the Sun. Pretty soon they have to prepare themselves for the ugly side of weather, the harsh winter. All summer there have been various events held in and around city making it a worthwhile tourist destination this time around the year. For past four days there was a food festival on. It is mainly showcasing the food from this part of world specialty being Reindeer meat and Solomon fish. A special note should be made for couple of Thai food vendors; sadly they were too selling non-veg food. Though I am a big foodie, being vegetarian my options had been really limited, out of fifty odd shops I could try only couple of things. Still the whole experience has been quite good also as it helped me check out Swedish girls. In the nights there was a band performing which used to get the whole neighborhood alive. Young hearts of all ages thronged the place in dead nights and danced under the tents and at times sing with the band.
Five more weeks to go and many things around Skellefteå, I hope to have more enriching experiences.
Few tips if you are travelling to Skellefteå:
* If travelling in Aug-Oct, carry an umbrella and a rain-coat.
* It would be handy to carry a cap to cover your ears and hand-gloves.
* For vegetarians, Max burgers offers veggie-burger, also you could get Falafels and veg burgers at other local vendors and of course there is subway with couple of pure veg products.
* Bikes are probably the best ways to move around in Skellefteå, you should be able to rent it for around 50SEK/day.

Thursday, August 26, 2010

Different Worlds



Vow, a lot of big events have happened in my life in last couple of months than last two years, I got possession of my house in Pune, I switched job, left Coriolis to work with Tieto and now I am visiting Sweden for seven weeks on official assignment. Though I had booked the flat for quite some time now, but getting the possession has changed lot of parameters, full EMI payments are being deducted from my account, a lot of money just vanishes in fixing little things in house and yeah this flat has made me a land-lord as well :-).
Tieto has been a quite a different experience, I spent four and half years at Coriolis, a twelve people strong company, but Tieto has offices possibly in each continent with more than seventeen thousand employees all over the world. The challenges for both the companies are quite different creating very different cultures and processes. Both of these things have caused subtle changes in my life but being in Sweden has had a direct impact on my lifestyle although for a short while only.
I am currently in Skellefteå, a small city even compared to Swedish standards with a population around 32k, and it is a very quiet place. But, like the whole of western world, it is well equipped with most luxuries of life. I have stayed in USA for few months and though back home when we might feel whole of western world is same, within a week I could spot lot of distinctions between the two places. US is more multi-cultured, it is very easy to spot Indians, Chinese, Koreans, Mexicans, Africans and of course Whites and natives. You can find Indian grocery shop and Indian restaurants on each corner and if you are (un)lucky you can catch Himesh Reshammiya performing live in concert. On the other hand, I did not find as many different races or colored people here in Sweden. Also, Indian food is kind of alien here. There are some products available in super-market offering Indian taste but they are all made in Britain and I am quite sure they must be lowered a lot in spices to comfort the western-stomachs so the purist that I am, I don't buy them instead preferring to settle for the native falafel :-)
Other big difference is language, it is not guaranteed here that everybody here would be fluent in English actually it is easy to bump in to people who know hardly any English. All the signboards are in Swedish though the script is Roman but the words are very different; their length and heavy usage of umlauts make them difficult to read and remember. In general I found people very friendly, relaxed and at leisure. In US, I used to see more cars and hardly any people. Definitely cars were shinier in US and you needed to get on freeways more often. Here bike-lanes are very well developed and highways are not as big. I must admit, I found US more political there is some charge, stress about US that is missing here. Of course being Europe and that too countryside, this place is more picturesque. I am not sure if this phenomenon is all over Sweden or it is limited to Skelleftea but lot of people here move around on cycles and even I am given one.
Alright folks this is it for now, I am hoping to check out more of Skellefteå and Sweden and possible other parts of Europe during next six weeks if things fall in place. bfn.

Sunday, July 11, 2010

LSD: Life, Success and Desires

You want tons of things in life, probably everything that you see around or ever dreamed off. But, what you want and what you get is rarely in sync, the happy case would be to get what you want or get more than that; sadly for most of us this does not happen often and even in the happy case we eventually get over it and in a while something else catches attention. Thus, life keeps on moving and we are almost always running after something. Also, all things come in packaged deals, you see benefit in something but overlooked the side-effects of it. So, first you struggle to achieve something and at times after getting what you want, you struggle with the unwanted features you got.

But, do people really attain Nirvana and move out from this rat-race (is it a rat-race??), ofcourse I have heard such people exist but not really met anyone in person, a person who has grown over all his desires, all the beautiful things life has to offer. I have seen many people who have been defeated by the pressures of pursuits and stopped going after what they want or some be afraid of failures, don't strive to achieve their wishes.

This brings me to think how to be happy? Does happiness has a relationship with success? In that case, how do you define success?

Clearly, by abjecting your desires, you leave less complicated life but that is not happy life. The path to happiness goes through fulfilling your desires. But, of-course when I say desires, I find it foolish to include desires that could be anti-social or for that matter which could be harmful to you in the long run, like the habit of excessive alcohol consumption or smoking. Most of us have heard success is a journey and not a destination but few mis-interpret it and think success is all about the fun along the ride without caring for the destination. Those people would be surprised by the destination they reach. But, it also does not mean that you just keep on running from one achievment to other. I intentionally changed the word to achievement in last sentence because success for me is not one journey to some destination, it is the amalgamation of all the desires and journeys along them. So, success for me would be, you dream for something and you put efforts to achieve it, did you enjoy pushing yourself and finally did you end up where you wanted to be? After which, the cycle completes and you move on to the next level in life.