Author: Editorial Team
-
Doubly linked list
Introduction In this tutorial, we are going to discuss Doubly Linked Lists (DLL), how they are structured, their advantages, disadvantages, and why they are often preferred over singly linked lists in certain situations. We will also look into Java’s built-in LinkedList class that uses a doubly linked list internally. What is a Doubly Linked List? A Doubly…
-
Linked list data structure
1. Introduction A Linked List is a linear data structure where elements (nodes) are stored in a sequence, and each node holds two components: the data and a reference to the next node. Unlike arrays, linked lists don’t need to be stored in contiguous memory locations, making insertions and deletions easier. In this tutorial, we…
-
Java Program to Reverse a Number
1. Problem For a given number n for example (1234), write a Java program to reverse the number (4321 in this case). 2. Steps reverse a number Here are the steps to reverse a number: 3. Program
-
Java Program to Check if a String is Palindrome
1. Problem A palindrome is a word, phrase, number, or sequence of characters that reads the same forward and backward (ignoring spaces, punctuation, and capitalization). Examples: 2. Steps to check if string is palindrome Here are the steps to check if a string is a palindrome: 3. Program Approach 2 Approach 3
-
Java program to check if two strings are anagram
1. Problem An anagram is a word or phrase formed by rearranging the letters of another word or phrase, typically using all the original letters exactly once. For example: 2. Steps to check if two strings are anagram 3. Program Java 8 Anagram Check using Streams Output: Explanation: Alternative Approach: Using Character Frequency Map You…
-
Java program to reverse an array
1. Problem statement Given an array A of integers, reverse this array A in linear running time using constant memory. 2. Solution The steps to reverse an array can be shown with the help of following figure: 3. Program Following is the program to reverse the array. Output: Approach 2
-
Array data structure
1. Introduction The goal of a data structure is to make operations as fast as possible such as inserting new items or removing given items from the data structure. Arrays are data structures where all the items are identified by an index – an integer starting with 0. The items of the array are located…
-
Abstract Data Type(ADT) vs Data Structures
1. Introduction Abstract Data Types (ADTs) and Data Structures are related but distinct concepts in computer science. In this short tutorial, we’ll discuss Abstract Data Type and Data Structures. 2. Abstract Data Types (ADTs) An ADT describes a conceptual model for data types by outlining the operations that can be performed on the data, without…
-
Method level security at resource server
1. Introduction In this tutorial, we’ll use method level security to protect our web service endpoint. Using method-level security, we can apply annotations above the method name to either permit or block the execution of the method depending on specific conditions. For instance, we can apply a security annotation to restrict the method’s execution to…
-
Role based access control with Keycloak
1. Introduction In this tutorial, you will learn what are roles and authorities and how they work in Spring. You will also learn how to configure your resource server to validate user role. In previous tutorials, we accessed a protected resource at a resource server using a valid token. In this tutorial, we’ll assign user…
