Javascript Program To Check For Balanced Brackets In An Expression (Well-Formedness) Using Stack
Given an expression string exp, write a program to examine whether the pairs and the orders of “{“, “}”, “(“, “)”, “[“, “]” are correct in exp....
read more
Javascript Program for Largest Sum Contiguous Subarray
Write an efficient program to find the sum of contiguous subarray within a one-dimensional array of numbers that has the largest sum....
read more
Javascript 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
Javascript Program To Find Next Greater Element
Given an array, print the Next Greater Element (NGE) for every element. The Next greater Element for an element x is the first greater element on the right side of x in the array. Elements for which no greater element exist, consider the next greater element as -1....
read more
Javascript Program To Check If A Singly Linked List Is Palindrome
Given a singly linked list of characters, write a function that returns true if the given list is a palindrome, else false....
read more
Javascript Program for Search an element in a sorted and rotated array
An element in a sorted array can be found in O(log n) time via binary search. But suppose we rotate an ascending order sorted array at some pivot unknown to you beforehand. So for instance, 1 2 3 4 5 might become 3 4 5 1 2. Devise a way to find an element in the rotated array in O(log n) time....
read more
Javascript Program For Reversing A Linked List In Groups Of Given Size – Set 1
Given a linked list, write a function to reverse every k nodes (where k is an input to the function)....
read more
Javascript Program For Flattening A Linked List
Given a linked list where every node represents a linked list and contains two pointers of its type:...
read more
Php 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
Javascript 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
Javascript Program For Adding Two Numbers Represented By Linked Lists- Set 2
Given two numbers represented by two linked lists, write a function that returns the sum list. The sum list is linked list representation of the addition of two input numbers. It is not allowed to modify the lists. Also, not allowed to use explicit extra space (Hint: Use Recursion)....
read more
Javascript Program For Reversing A Linked List In Groups Of Given Size- Set 2
Given a linked list, write a function to reverse every k nodes (where k is an input to the function). Examples:...
read more