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
Server Side Programming Articles - Page 1924 of 2650
15K+ Views
Monolithic architecture is built as one large system and is usually one code-base. Monolithic application is tightly coupled and entangled as the application evolves, making it difficult to isolate services for purposes such as independent scaling or code maintainability.It extremely difficult to change technology or language or framework because everything is tightly coupled and depend on each other.Microservices architecture is built as small independent module based on business functionality. In microservices application, each project and services are independent from each other at the code level. Therefore it is easy to configure and deploy completely and also easy to scale based ... Read More
124 Views
In this problem, we are given a sorting algorithm and a number n. Our task is to print an array of n elements that could not be sorted by the algorithm. i.e the algorithm will fail.Algorithmloop i from 1 to n-1 loop j from i to n-1 if a[j]>a[i+1] swap(a[i], a[j+1])Let’s look into this sorting algorithm, it is using two nested loops. The outer one will start from 1 to n-1 and inner one from i to n-1, and will check the value of inner loop element and outer loop elements at each iteration and ... Read More
148 Views
In this problem, we are given a string. Our task is to print a string that is closest to the current string and does not contain any adjacent duplicate characters.Let’s take an example to understand the problemInput: string = “good” Output: goadIn this example, we found that the elements at index 1 and 2 are the same, so we change the elements at index 2.To solve this problem, we will traverse the string and check if any two adjacent elements have are same. If yes, then change the second element (if i and i+1 elements are the same, change i+1 ... Read More
921 Views
In this problem, we are given a 2-dimensional matrix. And our task is to print the elements of the matrix in a counter-clockwise spiral from.Counterclockwise Spiral Form − It is a spiral traversal which starts from top-left and the goes in the counter-clockwise direction to first bottom-right-up-left.The counter-clockwise traversal will be 1 5 9 13 14 15 16 12 8 4 3 2 6 10 11 7.Let’s take an example to understand the problemInput: 2 4 6 1 7 9 5 0 3 Output: 2 1 5 0 3 9 7To solve this problem, we will be ... Read More
455 Views
In this problem, we are given a 2-dimensional matrix. Our task is to print all the elements of the matrix in reverse spiral form.Let’s take an example to understand the problemInput: 12 23 54 67 76 90 01 51 43 18 49 5 31 91 75 9 Output: 18 49 1 90 76 43 31 91 75 9 5 51 67 54 23 12We will start from the center of the matrix and print elements in reverse spiral direction taking four loops for printing elements in reverse direction.ExampleProgram to show the implementation of our solution Live Demo#include ... Read More
730 Views
In this problem, we are given a 2-dimensional matrix. Our task is to print the zigzag form of the matrix.Let’s take an example to understand the problemInput: 12 99 43 10 82 50 15 75 5 Output: 12 99 43 50 82 10 15 75 5To solve this problem, we will print the elements of the array in both directions (LtoR and RtoL). And change the direction using the flag variable.Example Live Demo#include using namespace std; void printZigZagPattern(int row, int col, int a[][5]) { int evenRow = 0; int oddRow = 1; while (evenRow
215 Views
In this problem, we are a 2d matrix and a point P(c, r). Our task is to print all elements of the matrix in a spiral form (anti-clockwise) that starts from a given point P.Let’s take an example to understand our problem, Input: matrix[][] = {{3, 5, 7} } Output:To solve this problem, we use 4 loops for printing elements. Each loop prints elements of its own direction. We will start our printing from point p and go on printing the spiral form.ExampleProgram to show the implementation of our solution Live Demo#include using namespace std; const int MAX = 100; ... Read More
510 Views
In this problem, we are given a 2D array. Our task is to print all the elements of the array starting from the first row, from left to right, then right to left in the next row and again from left to right and so on.Let’s take an example to understand the problem.Input: array = { {2, 5} {4, 9} } Output: 2 5 9 4To solve this problem, we will print elements in the given direction (LtoR and RtoL) of a row. And a flag element to show the direction of printing will switch after every iteration.This ... Read More
478 Views
In this problem, we are given a matrix. Our task is to print the matrix in reverse waveform in a single line.This example will make the problem clear, Input: 1 4 6 11 2 5 8 54 7 9 3 43 1 7 4 34 Output: 11 54 43 34 4 3 8 6 4 5 9 7 1 7 2 1To solve this problem, we have to print the reverse waveform of our matrix and for this, we will print the elements of the last column in the downward direction and then second-last column’s elements ... Read More
131 Views
In this problem, we are given two numbers K and D. Our task is to print a number of k digits and which has digital root equal to D.Digital Root is a single-digit value which is the result of the recursive addition of the digits of the number till the one a single-digit number is reached. Also known as a digital sum.Let’s take an example to understand the problem, Input: D = 5 , K = 6 Output: 60000To solve this problem, we will be using trials of zero’s after the number D. Our number will be {D000..(k-1 times)}. This ... Read More