# Tag Archives: Hike

Efficient approach: If we are allowed to buy and sell only once, then we can use following algorithm. Maximum difference between two elements. Here we… Read More
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… Read More
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… Read More
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… Read More
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… Read More
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… Read More
The cost of a stock on each day is given in an array, find the max profit that you can make by buying and selling… Read More
The cost of a stock on each day is given in an array, find the max profit that you can make by buying and selling… Read More
Write an efficient program to find the sum of contiguous subarray within a one-dimensional array of numbers that has the largest sum.    Recommended: Please… Read More
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… Read More
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… Read More
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… Read More
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… Read More
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… Read More
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… Read More