Given an input array of unsorted integers. Write a code to find second smallest number in an array.
For example :
arr = {-1, 7, 1, 34, 18}
The second smallest number in this array is 1.
Given a decimal number, Write a java program to convert decimal to binary number.
For example :
Input : 4 , Output : 100
Input : 5 , Output : 101
Input : 10 , Output : 1010
In this tutorial, Let’s discuss how to find middle element of a linked list in a single traversal.
Given a singly linked list, write a code to find middle element in a linked list.
For example: Given a linked list, the middle element in this linked list is 8.
15 -> 9 -> 8 -> 5 -> 6 -> NULL
This type of questions are generally asked in an interviews.
There are multiple approaches to solve this problem. In this tutorial, I am going to discuss two approaches through which we can find the middle element of a singly linked list in one pass.
I have also added video tutorial at the end of this post.