Month: September 2023

Delete Middle Element From Stack in Java

Published on:

In many applications, there might arise a need to modify the content of a stack. One such modification can be...

Read More

Reverse an Array Using Stack in Java

Published on:

Reversing an array is a fundamental problem in computer science. While there are several methods to reverse an array, using...

Read More

Reverse a String Using Stack in Java

Published on:

Reversing a string is one of the classical problems in the field of computer science. One of the most efficient...

Read More

Convert Singly Linked List Into Circular Linked List in Java

Published on:

A singly linked list is a type of data structure where each node points to the next node in the...

Read More

Deletion in Linked List in Java

Published on:

Deletion is one of the primary operations in a linked list, allowing us to remove a node based on its...

Read More

Count the Occurrence of an Integer in a Linked List in Java

Published on:

Counting the occurrence of an integer in a linked list is a fundamental operation that can be useful in various...

Read More

Pairwise Swap of a Linked List in Java

Published on:

Pairwise swapping of nodes in a linked list refers to swapping the data of every two adjacent nodes. This process...

Read More

Remove Every k-th Node of the Linked List in Java

Published on:

Linked lists are versatile data structures that allow for easy insertion and deletion of nodes. Occasionally, we might need to...

Read More

Implement a Stack Using Singly Linked List in Java

Published on:

A stack is a data structure that supports Last-In-First-Out (LIFO) semantics. The primary operations associated with a stack are push,...

Read More

Delete without Head Pointer in Java

Published on:

In traditional scenarios of deleting a node from a linked list, we have access to the head node, and we...

Read More

Deletion From a Circular Linked List in Java

Published on:

A Circular Linked List is a variation of a standard linked list in which the last node points back to...

Read More

Circular Linked List Traversal in Java

Published on:

A Circular Linked List is a variation of the standard linked list where the last node points back to the...

Read More

Detect Loop in Linked List in Java

Published on:

A common problem when dealing with linked lists is detecting if the list contains a loop. A loop in a...

Read More

Remove Duplicate Elements From Sorted Linked List in Java

Published on:

Linked lists are a fundamental data structure in computer science. When dealing with sorted linked lists, it's common to encounter...

Read More

Delete Middle of Linked List in Java

Published on:

A common task when working with linked lists is to delete the middle node. If the size of the linked...

Read More

Delete Last Occurrence of an Item From Linked List in Java

Published on:

In linked lists, deleting a node is a fundamental operation. However, a variant of this operation is to delete the...

Read More

Rotate a Linked List in Java

Published on:

Rotating a linked list involves repositioning its nodes such that the list is shifted by a specified number of positions....

Read More

Reverse a Linked List in java

Published on:

A Linked List is a data structure where elements, known as nodes, are connected by pointers. Each node contains a...

Read More

Reverse a Doubly Linked List in java

Published on:

A Doubly Linked List (DLL) is a list in which each node contains a data part and two pointers. The...

Read More

Java Program to Implement Ford-Fulkerson Algorithm

Published on:

The Ford-Fulkerson Algorithm is a method used to find the maximum flow in a flow network. It works by augmenting...

Read More

Java Program to Implement Johnson’s Algorithm

Published on:

ohnson’s Algorithm is a method to find the shortest paths between every pair of vertices in a sparse, edge-weighted, directed...

Read More

Java Program to Implement Dijkstra’s Shortest Path Algorithm

Published on:

Dijkstra’s Algorithm is a graph search algorithm that solves the single-source shortest path problem for a graph with non-negative edge...

Read More

Java Program to Implement Z-Algorithm for Pattern Matching

Published on:

The Z-Algorithm is a linear time pattern searching algorithm that helps find all occurrences of a pattern in a text....

Read More

Java Program to Implement KMP Pattern Matching Algorithm

Published on:

The KMP (Knuth-Morris-Pratt) Pattern Matching Algorithm is a linear time complexity algorithm used to find a pattern within a text....

Read More

Java Program to Implement Strassen’s Matrix Multiplication Algorithm

Published on:

Strassen's Matrix Multiplication is an algorithm for multiplying two matrices. The traditional method to multiply matrices requires O(n^3) operations, but...

Read More