Check whether Two Strings are Anagrams of each other

Write a program to check whether two strings are anagrams of each other.

What is an Anagram ?

Two strings are said to be anagrams of each other if it contains the same characters, only the order of characters in both the strings is different. In other words, both strings must contain the same exact letters in the same exact frequency.

Recursion vs Iteration – Difference between Recursion and Iteration

Recursion vs Iteration. What’s the difference between recursion and iteration. Recursion and Iteration both are two different programming approaches. In some cases recursion is best suited and in some other cases iterative way of programming is good.

In programming, repeated set of instructions can be handled either by using recursive or iterative approach in your code. So which approach you choose and why. Let’s talk about recursion vs iteration.

Implementation of Binary Search using Recursion.

Queue Data Structure Implementation Using an Array

Write a program to implement a queue using an array.  In this tutorial, You are going to learn about Queue data structure and their implementation using an array in C, C++ & Java. In my previous posts, I have explained Stack and Linked List data structure.

Queue Data Structure

In Queue data structure, An element is inserted at one end called rear and deleted at other end called front. As compared to stack data structure in which insertion and deletion are allowed only at one end. Queue data structure is also called FIFO (First In First out).

Program to Print Factorial of a Number in PHP – Iterative & Recursive Approach

Write a program to print factorial of a number in PHP. In this tutorial, We are going to write a PHP code to print factorial of a number using iterative as well as recursive approach. Before solving this problem let’s understand what is factorial.

Program to Print Factorial of a Number in PHP

Program to Print Factorial of a Number in PHP

Find Common Elements in Two Arrays – Intersection of two Arrays

Given two sorted arrays, Write a code to find common elements in two arrays. In other words, we have to write a code to find the intersection of two arrays.

Find Common Elements in Two Arrays

Let’s assume following two sorted arrays arr1[] and arr2[].

int arr1[] = {2,  3,  4,  5,  6};
int arr2[] = {4,  6,  7,  8,  9};

So the common elements in these two arrays is 4 and 6.