
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Found 26504 Articles for Server Side Programming

495 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 are 3 players then 2 games are required to decide the winner as follows −Game – 1: player 1 vs player 2Game - 2: player 2 vs winner from Game - 1AlgorithmWe can solve this problem by first computing minimum number of players required such that the winner will play ... Read More

177 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 it cannot be considered in the final solutions.If the length of the sub-string is even, then it can be a possible solution only if each character in that sub-string occurs even number of times which can be done using the dictionary count. We check if each character occurs even number ... Read More

428 Views
In programming data type denotes the type and nature of data which is intended to be use by the user. It is the data type which compiler or interpreter going to deal with and provides corresponding storing location in main memory.Now on the basis of nature of data Data type is mainly of two types one is Fundamental Data type and other is Derived Data type. Both these data types are used in programming and are equally important when need to implement the business logic over the data.Following are the important differences between Fundamental data types and Derived data typesSr. ... Read More

440 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 = 11 andSuffix sum = arr[3..6] = 5 + 3 + 2 + 1 = 11AlgorithmTraverse the array and store prefix sum for each index in array presum[], in which presum[i] stores sum of subarray arr[0..i]Traverse array again and store suffix sum in another array suffsum[], in which suffsum[i] stores ... Read More

488 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 will process (total_elementes/N) array elements and will find maximum element from it.Finally compute the maximum from the maximum value reported by each thread.Example#include #include #include #include #define MAX 10 #define SIZE(arr) (sizeof(arr) / sizeof(arr[0])) typedef struct struct_max { int start; int end; int ... Read More

589 Views
A sorted and rotated array is an array that is sorted in ascending or descending order and then rotated either left or right by a specific number of elements. There should exist exactly one pivot point around which the array is rotated. In this article, our task is to find the maximum element in the given sorted and rotated array. We will use the following two approaches mentioned below: Using Linear Search Using Binary Search Example Here is an example of ... Read More

3K+ Views
As we all know that C# is an object oriented programming just like Java and provides full support for object-oriented concepts that are Encapsulation, Abstraction, Inheritance, and Polymorphism. In contrast to Abstraction both Abstract class and Interface are coming out in picture as both of these provides abstraction in C# program.In an abstract class, we can create the functionality and that needs to be implemented by the derived class. The interface allows us to define the functionality or functions but cannot implement that. The derived class extend the interface and implement those functions.Following are the important differences between Abstract Class ... Read More

6K+ Views
As we know that programming in any language get starts with declaration a variable after which its definition and logic implementation take place. So it is one of the most important factors to know that how to declare variable in any programming language before starts coding in it.Now if we take an instance of C# language there is change in declaration in variable with the advancement in the language. As in former version of C# all the code written was validated at the compile time itself which made it as Static typed language where variables are getting declared using var ... Read More

32K+ Views
In C, we have containers to hold data of same data type as well as different data types. C provides the concept of Arrays to store data variables of same type; while for storing data of different types, C has the concept of structures and unions. Both Structures and Unions can hold different types of data, but on the basis of their internal implementation, we can find several differences in both of these containers. Read this article to learn more about structures and unions and how they are different from each other. What is Structure in C Program? In C ... Read More

337 Views
Suppose we have an array that represents elements of arithmetic progression in order. One element is missing. We have to find the missing element. So if arr = [2, 4, 8, 10, 12, 14], output is 6, as 6 is missing.Using binary search, we can solve this problem. We will go to the middle element, then check whether the difference between the middle and next to the middle is the same as diff or not. If not, then the missing element is present between indices mid and mid + 1. If the middle element is the n/2th element in the ... Read More