Python Program For Finding The Middle Element Of A Given Linked List
Given a singly linked list, find the middle of the linked list. For example, if the given linked list is 1->2->3->4->5 then the output should be 3. If there are even nodes, then there would be two middle nodes, we need to print the second middle element. For example, if given linked list is 1->2->3->4->5->6 then the output should be 4....
read more
Qualcomm Interview Experience | Set 5(For Experienced)
I recently got a call from Qualcomm Hyderabad for Engineer position. I am from CS background and had 1 year experience....
read more
Program to find whether a given number is power of 2
Given a positive integer n, write a function to find if it is a power of 2 or not...
read more
C++ Program To Add Two Numbers Represented By Linked Lists- Set 1
Given two numbers represented by two lists, write a function that returns the sum list. The sum list is a list representation of the addition of two input numbers....
read more
Binary Search Algorithm – Iterative and Recursive Implementation
Binary Search Algorithm is a searching algorithm used in a sorted array by repeatedly dividing the search interval in half. The idea of binary search is to use the information that the array is sorted and reduce the time complexity to O(log N)....
read more
Merge Sort – Data Structure and Algorithms Tutorials
Merge sort is a sorting algorithm that follows the divide-and-conquer approach. It works by recursively dividing the input array into smaller subarrays and sorting those subarrays then merging them back together to obtain the sorted array....
read more
C Program For Sorting An Array Of 0s, 1s and 2s
Given an array A[] consisting 0s, 1s and 2s. The task is to write a function that sorts the given array. The functions should put all 0s first, then all 1s and all 2s in last.Examples:...
read more
C Program For Finding The Length Of Loop In Linked List
Write a function detectAndCountLoop() that checks whether a given Linked List contains loop and if loop is present then returns count of nodes in loop. For example, the loop is present in below-linked list and length of the loop is 4. If the loop is not present, then the function should return 0....
read more
Python Program For Finding The Length Of Loop In Linked List
Write a function detectAndCountLoop() that checks whether a given Linked List contains loop and if loop is present then returns count of nodes in loop. For example, the loop is present in below-linked list and length of the loop is 4. If the loop is not present, then the function should return 0....
read more
Java Program For Printing Nth Node From The End Of A Linked List
Given a Linked List and a number n, write a function that returns the value at the n’th node from the end of the Linked List.For example, if the input is below the list and n = 3, then the output is “B”....
read more
Java Program For Printing Nth Node From The End Of A Linked List(Duplicate)
Given a Linked List and a number n, write a function that returns the value at the n’th node from the end of the Linked List.For example, if the input is below list and n = 3, then output is “B”...
read more
Queue – Linked List Implementation
In this article, the Linked List implementation of the queue data structure is discussed and implemented. Print ‘-1’ if the queue is empty....
read more