Program to Swap Two Numbers Using Bitwise XOR Operator

Swapping two numbers using Bitwise XOR operator is tricky one and it’s generally asked in interviews. There are other two methods also through which you can swap two numbers.

Stack Program in C using an Array – Stack Tutorial Part – I

Write a stack program in C using an array. Implement a stack data structure using an Array. In this tutorial, You are going to learn about stack data structure and it’s implementation in C using an array.

C Program to Implement a Stack using Linked List

Subscribe Our Tutorials

What is a Stack Data Structure?

A Stack is a Data Structure, in which insertion and deletion operations are allowed only at one end. It worked on LIFO (Last In First Out) Principle. In LIFO, an element which inserted last must be the first element to be removed.

C Program to Reverse a Linked List

Write a C program to reverse a linked list. Given a singly linked list, we have to write a code to reverse a linked list. In this tutorial, we are going to use iterative approach to solve this problem.

C Program to Insert a Node at the Beginning of Linked List

Write a C program to insert a node at the beginning of linked list. In this tutorial, we create a linked list and insert a new node at the beginning/head of linked list.

A Linked list is a linear data structure which consists a group of nodes and each node points to next node by means of a pointer. In Linked list, a node consists of two parts, a data and a pointer to next node.

Recursion Concept with Example

What is recursion and how to use recursion in programming. If you are new to programming, then recursion concept is tough to understand. In this post, i’ll explain the concept of recursion with example.

What is Recursion ?

In Recursion, function call itself repeatedly, until the base condition is reached.  It’s a much preferred way to write cleaner and shorter code for many complex problems.

Through recursion, you can reduce complex problem into smaller version.

Find Duplicate Elements in an Array – Java Program

Write a java program to find duplicate elements in an array. There are multiple ways through which we can find duplicate elements in an array. In this tutorial, I’ll discuss three ways to find duplicate elements in an array.
This question is also very important in terms of technical interviews.

Selection Sort Program in C

Write a selection sort program in C. Given an unsorted array, write a c code to sort an array using selection sort.

For example :

Input : {9, 8, 19, 2, 3 }
Output : { 2, 3, 8, 9, 19}

What is Selection Sort?

Selection sort is an in-place comparison technique. In selection sort, we pick minimum element and move an element to it’s correct position. We repeat this process until all the elements are sorted.

The time complexity of selection sort is O(n^2). It is not suitable for large data sets.

Bubble Sort Program in Java

Bubble Sort Program, Algorithm & their Time Complexity

Bubble Sort program, Algorithm & their time complexity.In this tutorial, We are going to learn about bubble sort algorithm and their implementation in various programming languages.

In this tutorial, we are going to cover following things

• What is Bubble Sort?
• Bubble sort algorithm & it’s time complexity
• Bubble sort program in C & C++
• Bubble sort implementation in PHP

What is Bubble Sort?

Bubble sort is a sorting algorithm, It works by comparing each pair of adjacent elements and switching their positions if necessary. It repeats this process until all the elements are sorted.

C Program to Swap two Numbers without using third variable

Write a c program to swap two numbers without using third variable. Given two input numbers, We have to write a code to swap two numbers without using third variable. In my previous post, I have explained a c program to swap two numbers using third variable. This question is generally asked in an interview.

Swap two numbers using Bitwise XOR Operator

C Program to Swap Two Numbers using Third Variable

Write a c program to swap two numbers using third variable. Given two input integers, We have to write a code to swap two numbers using a third or temporary variable.

C Program to swap two numbers without using third variable

Swap two numbers using a pointer

Swap two numbers using bitwise XOR operator

Programming questions on various topics for practice