Article Categories
- All Categories
-
Data Structure
-
Networking
-
RDBMS
-
Operating System
-
Java
-
MS Excel
-
iOS
-
HTML
-
CSS
-
Android
-
Python
-
C Programming
-
C++
-
C#
-
MongoDB
-
MySQL
-
Javascript
-
PHP
-
Economics & Finance
Articles on Trending Technologies
Technical articles with clear explanations and examples
3-Way QuickSort (Dutch National Flag)
The 3-Way QuickSort, also known as the Dutch National Flag algorithm, is an optimized version of the standard QuickSort algorithm. While traditional QuickSort partitions the array into two parts (less than and greater than pivot), 3-Way QuickSort creates three partitions: elements less than pivot, equal to pivot, and greater than pivot. Syntax void partition(int arr[], int left, int right, int *i, int *j); void quicksort3Way(int arr[], int left, int right); Algorithm The partition function divides the array into three sections − partition(arr, left, right, i, j): if right - left
Read MoreA Space Optimized Solution of LCS in C Program?
Here we will see one space optimized approach for LCS problem. The LCS is the longest common subsequence. If two strings are "BHHUBC" and "HYUYBZC", then the length of the subsequence is 4. One dynamic programming approach is already there, but using the dynamic programming approach, it will take more space. We need table of order m x n, where m is the number of characters in first string, and n is the number of characters in the second string. Here we will see how to implement this algorithm using O(n) amount of auxiliary space. If we observe the ...
Read MoreSet printing double-sided documents with CSS
When printing double-sided documents, the page boxes on the left and right pages should be different. CSS provides pseudo-classes to define different styles for left and right pages, allowing you to set appropriate margins for binding. Syntax @page :left { /* Styles for left pages */ } @page :right { /* Styles for right pages */ } Example The following example sets different margins for left and right pages to accommodate book binding − @page ...
Read MoreOrphans CSS Property
In typographic terminology, orphans are lines of a paragraph stranded at the bottom of a page due to a page break, while widows are lines remaining at the top of a page following a page break. Generally, printed pages do not look attractive with single lines of text stranded at the top or bottom. Most printers try to leave at least two or more lines of text at the top or bottom of each page. The orphans property specifies the minimum number of lines of a paragraph that must be left at the bottom of a page. The ...
Read MoreA Peterson Graph Problem in C Program?
The Peterson Graph is a specific undirected graph with 10 vertices and 15 edges. In this problem, we need to find a walk through the Peterson Graph that realizes a given string pattern. Each vertex is labeled with a letter (A-E), and we must find a path where the sequence of vertex labels matches our target string. ...
Read MoreControlling Pagination with CSS
The CSS pagination properties allow you to control how content breaks across pages when printing or creating PDFs. These properties help ensure your content flows logically and looks professional in print format. Syntax selector { page-break-before: value; page-break-after: value; page-break-inside: value; } Possible Values ValueDescription autoDefault. Browser generates page breaks as needed alwaysForces a page break before or after the element avoidAvoids page breaks before, after, or inside the element leftForces page breaks to render element on a left-hand page rightForces ...
Read MoreA C/C++ Pointer Puzzle?
This C programming puzzle demonstrates how pointer arithmetic works with different types of pointers and multi-dimensional arrays. Understanding pointer sizes and type differences is crucial for mastering pointer arithmetic in C. Syntax sizeof(pointer_variable) (char*)(pointer + 1) - (char*)pointer Example: Pointer Arithmetic Puzzle Let's analyze this step-by-step with a complete C program that demonstrates pointer arithmetic with various pointer types − #include int main() { int a[4][5][6]; int x = 0; int* a1 = &x; ...
Read MoreUsage of page-break-before, page-break-after, and page-break-inside properties in CSS
CSS provides three properties to control page breaks when printing documents: page-break-before, page-break-after, and page-break-inside. These properties help you manage how content flows across printed pages, ensuring proper layout and avoiding unwanted breaks. Syntax selector { page-break-before: value; page-break-after: value; page-break-inside: value; } Possible Values PropertyValuesDescription page-break-beforeauto | always | avoid | left | rightControls page break before element page-break-afterauto | always | avoid | left | rightControls page break after element page-break-insideauto | avoidControls page break inside element ...
Read More3-digit Osiris number C Program?
An Osiris number is a special 3-digit number that equals the sum of all permutations of its 2-digit sub-samples. For example, 132 is an Osiris number because 12 + 21 + 13 + 31 + 23 + 32 = 132. Syntax bool isOsirisNumber(int n); Algorithm The approach is straightforward. For a 3-digit number, each digit appears exactly twice in the permutations − once in the tens position and once in the ones position. Therefore, we can check if the number equals 22 times the sum of its digits. Begin ...
Read MorePaged Media in CSS
Paged media differ from continuous media in that the content of the document is split into one or more discrete pages. Paged media includes paper, transparencies, pages that are displayed on computer screens, etc. The CSS2 defines a page box, a box of finite dimensions in which content is rendered. The page box is a rectangular region that contains two areas − The page area − The page area includes the boxes laid out on that page. The edges of the page area act as the initial containing block for a layout that ...
Read More