Friday, June 21, 2013

Munnar : Kerala

In June first week, I was again able to get a weekend off to the nature's lap. And this time it was in God's own country, Kerala. We choose to go to Munnar,As we have heard a lot about it. So here is my experience:

How to go: As there is no raliway station in Munnar, you have to take a bus or cab, Still I will suggest go by train as much as possible. So from Bangalore we took Kanyakumari express which took us to Aluva. From here you can take cab or bus to reach Munnar. But here is a tip, it will be good if you can take a cab from here for your whole stay, as the cab driver charge for both ways even if you want to go for Munnar only. It cost us 2000 for one side.

Where to stay: As Munnar is a major tourist attraction, you will find plenty of hotels, resorts or home stays. But if you are planning in some long weekend, I will suggest you to book in advance, otherwise you might end up in paying a lot for very nominal accomodation. We stayed in WoodPecker Resort, and it was really good. Service, food all were good, the only thing is don't depend on them for your local sight seeing or booking cab.

What places to visit: There are many small places in Munnar, but we cover only 6 places. First day we covered Top Station(really awesome place), Mattupetty Dam, Echo point, Kundala Dam, these all are on same way.
Next day we went to Rajamalai National Park (Eravikulam National Park)[Awesome view],Lakkom waterfalls. On the way to munnar also you will find many small waterfalls, apart from that the spread of green valley and the mist of mountain will always bound you to stop you car for a minute and enjoy the view.
One more place we went was Tata Tea Museum, if you want to be Tea-educated, I think you should go there for sure, and I can assure you that you will love the Tea which they serve in the last..

What else to do: Apart from enjoying the view and major places, you can try trekking over there. And if interested you can go for shopping for different kind of Tea(Kandann devan specially), Home Made chocolate,different Spices, Herbal oils and handicrafts.

Misc: For a foodie, you can try many local items there but mainly for non-veggie, although veggies will always have their usual options. Language will also not be a big issue, as many ppl will be able to understand english.

As it was very short trip, I covered only few places, but there are many other places too. So if you have time go for those also. 

Wednesday, June 19, 2013

Double Ended Queue or Deque : Insertion/ Deletion

Hi All,

one more post coming up about the double ended queue which is also known as deque. A deque is a special type of data-structure in which insertion and deletion can be done at both end. So there are 5 operations for deque.

1. Insert element at front end.
2. Insert element at rear end.
3. Delete element from front end.
4. Delete element from rear end.
5. Display the elements of the deque.

So let me introduce the code for each of these function one by one. Here I will be using f for front index and r for rear index.

1. Insert element at front end.

Here there are 3 cases which needs to be taken care of

case 1. When queue is empty, so here is the code :

if(f == 0 && r == -1)
{
Queue[++r] = val; //value which needs to be added.
return;
}

case 2. when queue have element, but some elements from front has been deleted

if(f != 0)
{
Queue[--f] = val;
return;
}

case 3: when queue is full

if(f ==0 && r != -1)
{
printf("No Space left");
return;
}

2. Insert at rear end

Here only 2 cases needs to take care

case 1. if queue is full

if(r == Queue_SIZE - 1)
{
printf("No Space left");
return;
}

case 2. otherwise

else
{
Queue[++r] = val;
}

3. Delete from front end

Here there will be 3 cases.

case 1 : When front index has larger index than rear, it means there is no elements

if(f>r)
{
printf("No element left to delete");
return;
}

case 2. When there is only one element in the queue

if(f==r)
{
printf("deleted element is = %d",Queue[r]);
f = 0;
r =-1;
return;
}

case 3. otherwise

else
{
printf("deleted element is = %d",Queue[f++]);
}

4. Delete from rear end

Here there will be 2 cases.

case 1. when there is no element

if(f>r)
{
printf("No element to delete");
return;
}

case 2. otherwise

else
{
printf("Deleted element is = %d\n",Queue[r--]);
// now only one element was there in queue then adjust rear and front index
if(f>r)
{
f = 0;
r = -1;
}

5. Display the element

int i;
for(i = f; i
{
printf("%d ",Queue[i]);
}

Hope it will help you to understand the complete logic.