Padding and Packing in C Programming

Data structure alignment is the way data is arranged and accessed in computer memory. It consists of two separate but related issues: data alignment and data structure padding. When a modern computer reads from or writes to a memory address, it will do this in word sized chunks (e.g. 4 byte chunks on a 32-bit … Read more

Linear Search in Java

What is Linear Search? Linear search or sequential search is a method for finding a particular value in a list that checks each element in sequence until the desired element is found or the list is exhausted. Its worst case cost is proportional to the number of elements in the list. Its expected cost is … Read more

Program to implement Hash Tables in Java

What is Hash Table? Hash tables are an efficient implementation of a keyed array data structure, a structure sometimes known as an associative array or map. If you’re working in C++, you can take advantage of the STL map container for keyed arrays implemented using binary trees, but this article will give you some of the theory behind … Read more

Program to implement RSA algorithm in C

Today we will write a program to implement RSA algorithm in C programming language, so let’s first understand what is RSA algorithm. What is RSA Algorithm? RSA is one of the first practical public-key cryptosystems and is widely used for secure data transmission. In such a cryptosystem, the encryption key is public and differs from … Read more

Red Black-Tree(RB-Tree) implementation in C++

Red Black-Tree (RB-Tree): A red-black tree is a binary search tree with one extra attribute for each node: the colour, which is either red or black. It has following properties: Every node is either red or black. Every leaf (NULL) is black. If a node is red, then both its children are black. Every simple … Read more

Program to implement Circular Queue in JAVA

In this post we will learn about what are circular queues and how to implement circular queue in Java programming language. So, let’s start with definition of circular queue What is Circular Queue in Java? In  a standard queue data structure re-buffering problem occurs for each  dequeue operation. To solve this problem by joining the … Read more