July 11, 2020

Stack Implementation using C language

You can watch me live code the Stack Datastructure on youtube. You can get the entire source code from github I have put all the function declaration in a header file. struct Stack{ int top; int capacity; int *data; }; //Creation struct Stack *createStack(int *capacity); //Deletion int deleteStack(struct Stack *stack); //Status Checks int isStackFull(struct Stack *stack); […]

Read more
January 26, 2019

Create a complete binary tree from an array of data in java

Note :- Using java 8 and above. Hi there… Today, I am going to write a java program which will take an var-arg of character, you can use any data-type you want. Data type is not the focus here. The main focus is the  process of creating a binary tree. I am using functional programming to do […]

Read more
December 29, 2018

Write a utility function to create linked list from a sequence of items – using iteration and recursion

While working on linked data-structures, we have to create linked lists regularly. To ease that process, we can create a utility function, which creates linked list from given data and returns head of the new linked list. Our functions will accept a variable argument and it will return a Node. We are using Node class […]

Read more
December 29, 2018

Create a Node class using java generic – for linked list

This class can not be used in any practical scenario. Because, the data part is going to be a lot different. While learning the datastructures and algorithms, this class is going to be very useful. While working on any linked datastructures, we create a class which acts as a node. And, It has following fields. […]

Read more
December 26, 2018

Find length of a linked list using recursion

You can read about calculating length of a linked list by iterative method here. In recursion, the iterative loop or explicit loop is replaced by recursive function calls. In recursive calls, a stack is used to store values calculated during the recursion. And when stack unfolds, the recursion calls are replaced by those values. Let […]

Read more