Data Structure and Algorithms

Data Structure and Algorithms are the building blocks of computer programming. A well-defined data structure helps us in keeping our data organized. Some of the commonly used data structures are List, Queue, Stack, Tree etc.

The algorithms provide different ways to achieve a task on these data structures. Some of the common algorithms are in the area of sorting and searching elements in the data structure.

Binary Tree Level Order

Level Order Traversal in a Binary Tree

Level Order Traversal is one of the methods for traversing across a Binary Tree. In this article, we shall look at how we can implement this algorithm in C/C++. But before that, let us have….

Binary Tree Traversals

Binary Tree Traversal (PreOrder, InOrder, PostOrder)

In this article, we shall look into how we can perform a Binary Tree Traversal using different methods. A Binary Tree is a data structure where every node has at most two children. We call….

LRU Cache Java

LRU Cache Implementation in Java

What is LRU Cache? LRU Cache stands for Least Recently Used Cache. The size of the cache is fixed and it supports get() and put() operations. When the cache is full, the put() operation removes….

Finding and Checking Prime Numbers in Java

What is a Prime Number? A prime number is a natural number greater than 1 that is only divided by 1 and itself. For example, 5 is a prime number because it can be divided….

Merge Sort Algorithm – Java, C, and Python Implementation

Merge sort is one of the most efficient sorting algorithms. It works on the principle of Divide and Conquer based on the idea of breaking down a list into several sub-lists until each sublist consists….

Arrays in C

Why do we need Arrays? Consider the problem of storing 10 integers. The naive way to store these integers would be to create 10 different integers variables and store 1 integer in each of them…..

Linked List Insert Delete Methods

Linked List Insert Methods Linked List insert methods allow us to insert a Node at a specific place. There are three insert methods based on the position where the new node is inserted. addLast addFirst….

Linked List vs Array

Linked List and Array are probably the most basic data structures, but their use can often be confusing. The use of the appropriate data structure can often result in an easier and more efficient code…..

Introduction to Linked List (Java implementation)

A linked list is a linear data structure that contains a sequence of elements such that each element has reference to the next element in the sequence. Each element in the linked list is called….

How to Find Length of a Linked List?

What is a Linked List? A linked list is a linear data structure used for storing collections of data Successive elements are connected by pointers The last element points to NULL Each element is a….

Generic selectors
Exact matches only
Search in title
Search in content