DSA

Search an element in a Singly Linked List

Algorithm First check, If the head is null then simply return -1 Create one variable position Create a new node current and node current wi...

ProCodePlan 18 Jul, 2022

Remove a Node from a Singly Linked List

Remove the first node from a singly linked list: public void deleteFirst() { if(head==null) { return; } Node current = head; h...

ProCodePlan 12 Jul, 2022

Add a node at the end of a Singly Linked List

We will see how to add a node at the end of a Singly Linked List. Basically, a new node will be added after the last node of the given Singl...

ProCodePlan 9 Jul, 2022

Find length of a Singly Linked List

We will see how to Find the length of a Singly Linked List. Firstly, define a Node name current and assign the head to the current because w...

ProCodePlan 7 Jul, 2022

Iterative Postorder Traversal of a Binary Tree

Iterative Postorder Traversal of a Binary Tree Visit all the nodes in the left subtree Visit all the nodes in the right subtree Visit the ro...

ProCodePlan 17 Apr, 2022

Binary Tree Java

A binary tree is a tree in which no node can have more than two children. Each node has a parent node and two children. Every binary tree ha...

ProCodePlan 17 Feb, 2022 4

Singly Linked Lists

Singly Linked Lists    A linked list, in its simplest form, is a collection of nodes that together form a linear ordering. In that each no...

ProCodePlan 10 Feb, 2022