Leave a comment

Specifying JVM heap size while running a program in eclipse

If you are running a program in eclipse and want the execution to happen with a specific value of heap size, –

  • Right click on application -> Run as.. -> Run Configurations -> Open Argument tab
  • Now, under VM arguments, specify :

          -Xms128m -Xmx256m

  • Continue Reading »

Advertisements
Leave a comment

Introduction to Java – Part II

Object oriented programming languages like Java focuses on modeling of objects for developing an application. These objects can be defined by 2 characteristics : state and behavior. Here, let’s understand this with the help of an example.
Continue Reading »

Leave a comment

Introduction to Java – Part I

Java, on the whole, can be divided into 2 parts :

  • Programming language – this is basically a specification which describes various rules for writing a program in Java
  • Platform – this refers to the underlying system for running a Java application.

Continue Reading »

Leave a comment

Segmentation Fault in HBase

I got this error while creating HBase tables. After some investigation and google searches, the conclusion was – this error comes up if we are not using correct version of Java. Please upgrade your Java to at least JDK 1.6 SR 10 to get rid of this error.
Hope this helps!!

Leave a comment

Find the loop in a given Link List. Analyze the complexity of solution.

Link list is one of those data structures on which you can find a lot of stuff on internet. From a very simple problem to a complex one. Here in this blog also we are going to discuss problems along the same line.
Continuing in the same direction, let’s discuss our first problem. Suppose you have given a link list and there is a loop in the list. For understanding, you can assume a link list and someone might have modified the next address field (remember the structure of the node of link list?) of its last node and made it pointing to some node in the middle of the list. Got the point? We need to find out if there is a loop in the list. If loop is there, which node is the starting point of loop? (as in below list, 4 is the starting point)
Continue Reading »

Leave a comment

Understanding Linked List

We need data structure while writing the program. Doesn’t matter if it is a small program or a complex application, but you need data structures to hold your data so that you can process the data whenever required. Each data structure as its own pros and cons. For an example, in array you have direct access to each element so, you can access element in constant time but the problem with array is you need to declare the size of the array in prior and you cannot store more elements than the size of the array. Size is required at the time of declaration of the array itself because that many contiguous blocks of memory will be allocated to this array and that is the reason you have direct access to each element.
Continue Reading »

Leave a comment

What is stack? How to implement it?

Most of us already know that Stack is a data structure which allow us to process data in a particular manner called Last in First out, which means that the data stored last will be processed first. For an example if we have to store data 1 2 3 4 5, 1 will be in bottom of stack and 5 will be on top of stack. Stack does not have any operation which allow us to read data which is not on top of stack. At any point of time we have access to the data stored at top.
We can think of an array which allow us to access the data stored at highest index at any moment.
Continue Reading »