- Trending Categories
- Data Structure
- Networking
- RDBMS
- Operating System
- Java
- MS Excel
- iOS
- HTML
- CSS
- Android
- Python
- C Programming
- C++
- C#
- MongoDB
- MySQL
- Javascript
- PHP
- Physics
- Chemistry
- Biology
- Mathematics
- English
- Economics
- Psychology
- Social Studies
- Fashion Studies
- Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Narendra Kumar has Published 196 Articles
Narendra Kumar
107 Views
Problem statementGiven lengths of n rods in an array. If any person picks any rod, half of the longest rod (or (max + 1) / 2 ) is assigned and remaining part (max – 1) / 2 is put back. It may be assumed that sufficient number of rods are ... Read More
Narendra Kumar
67 Views
Problem statementGiven an array arr[] of N elements (0 ≤ arr[i] ≤ 1000). The task is to find the maximum length of the sub-array that contains only ugly numbers.Ugly numbers are numbers whose only prime factors are 2, 3 or 5.For Example below are the few number from series: 1, ... Read More
Narendra Kumar
69 Views
Problem statementGiven an array, we need to find the maximum height of the triangle which we can form, from the array values such that every (i+1)th level contain more elements with the larger sum from the previous level.ExampleIf input array is {40, 100, 20, 30 } then answer is 2 ... Read More
Narendra Kumar
404 Views
Problem statementThere are N players which are playing a tournament. We need to find the maximum number of games the winner can play. In this tournament, two players are allowed to play against each other only if the difference between games played by them is not more than oneExampleIf There ... Read More
Narendra Kumar
98 Views
Problem statementGiven a string the task is to find the maximum length of the sub-string of that can be arranged into a Palindrome.ExampleIf input string = “5432112356” then answer is 6 as maximum palindrome substring is “321123” and its length is 6AlgorithmIf the length of the sub-string is odd, then ... Read More
Narendra Kumar
349 Views
Problem statementGiven an array arr[]. Find maximum value of prefix sum which is also suffix sum for index i in arr[].ExampleIf input array is −Arr[] = {1, 2, 3, 5, 3, 2, 1} then output is 11 as −Prefix sum = arr[0..3] = 1 + 2 + 3 + 5 ... Read More
Narendra Kumar
375 Views
Problem statementGiven a very large array of integers, find maximum within the array using multithreadingExampleIf input array is {10, 14, -10, 8, 25, 46, 85, 1673, 63, 65, 93, 101, 125, 50, 73, 548} thenmaximum element in this array is 1673AlgorithmLet us call array size as total_elementsCreate N threadsEach thread ... Read More
Narendra Kumar
373 Views
DescriptionGiven a sorted array of distinct elements which is rotated at some unknown point, the task is to find the maximum element in it.ExampleIf input array is {30, 40, 50, 10, 20} then maximum element is 50.AlgorithmThe maximum element is the only element whose next is smaller than it. If ... Read More
Narendra Kumar
186 Views
Problem statementGiven an array of N elements and two integers A, B which belongs to the given array. Create a Binary Search Tree by inserting element from arr[0] to arr[n-1]. The task is to find the maximum element in the path from A to B.ExampleIf array is {24, 23, 15, ... Read More
Narendra Kumar
304 Views
Problem statementGiven an undirected tree which has even number of vertices, we need to remove the maximum number of edges from this tree such that each connected component of the resultant forest has an even number of vertices.ExampleIn above shown tree, we can remove at max 2 edges 0-2 and ... Read More