Move Non-Zero Array Elements to Left using Java

Introduction This examples shows how to move all non-zero elements (if any) in an array to the left and all zero elements to the right of the array using Java. Your integer array may hold zero (0) and non-zero (1, 2, 4, etc.) elements. You have a requirement to have all non-zero elements first followed by 0 elements in the…

Solving Josephus Problem using Java

Introduction The Josephus problem (or Josephus permutation) is a theoretical problem related to a certain counting-out game. The problem is described as below. People are standing in a circle waiting to be executed. Counting begins at a specified point in the circle and proceeds around the circle in a specified direction. After a specified number of people are skipped, the…

Binary Tree using pointer in C

Introduction Here we will see example on binary tree using pointer in C programming language. The same concept can be used in other language to write program for binary tree. What is Binary Tree? Binary tree is an important class of tree in data structure. A node in binary tree can have at most two children, which are called sub-trees….

Tic-tac-toe game using Java

Tic-tac-toe (also known as noughts and crosses or Xs and Os, respectively) is a paper and pencil game for two players, X and O, who take turns marking the spaces in a 3×3 grid. The player who succeeds in placing three of their marks in a horizontal, vertical, or diagonal row wins the game. Here we will see how this…

Creating and Building Jobs in Jenkins

Introduction Here I will show you an example on creating and building jobs in Jenkins. We know that Jenkins is a build tool that helps us to automate building, releasing and deploying of the application to appropriate environment. But before we start building application, we need to create a job for that application. Then only we will be able to…

Queue using Linked List in C Program

Introduction We will create an example on queue using linked list in C program. A queue like a stack is another special type of ordered list. In queue insertion operations are permitted at one end of the list and deletion operations are performed at the other end of the list. The end where insertion operations are performed is called rear…

Manage Jenkins – Configuring JDK, GIT and Maven

Introduction Here I will show you how to manage Jenkins – configuring JDK, GIT and Maven installations. We build mainly Java applications (also .NET applications) using Jenkins. Therefore we need to have everything which are required to perform build operation of Java applications, i.e., we need to have JDK, GIT or SVN or any other source repository and Maven or…

Stack using Linked List in C Program

Introduction We will see how to create stack using linked list in C program. Stack is a special kind of linear list. Linear list is an ordered collection of a number of items of the same type. Two operations are performed frequently from linear list – insertion and deletion. A stack is a linear list where all insertions and deletions…

Jenkins Setup in Windows

Introduction This tutorial is about Jenkins setup in Windows and shows you how you can configure the most popular build tool in Windows environment. If you have ever worked on production support or support project where you need to monitor the applications as well as you need to enhance the functionalities of the application then you may find Jenkins setup…

Spring Data JPA Entity Graphs

One of the important features in Spring Data JPA or simply JPA is the ability to specify fetch plans using Entity Graphs. This is useful since it allows you to customize the data, which is retrieved with a query or find operation. It is expected to display data from the same entity in different and several ways when working with…