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
Storage Device Hierarchy
Computer storage has components that store computer data. The storage device hierarchy organizes these components based on speed, cost, and capacity. The hierarchy follows a trade-off principle: faster storage is more expensive and has lower capacity, while slower storage is cheaper with higher capacity. Storage Device Hierarchy CPU Registers Cache Memory Primary Storage (RAM) ...
Read MoreComputer Storage Definitions and Notations
Computer storage contains many components that are used to store computer data. Understanding the different types of storage devices and their capacity measurements is essential for working with modern computing systems. Computer Storage Types Computer storage devices are classified into Primary and Secondary Storage devices based on their accessibility by the CPU and data permanence. Computer Storage Hierarchy Computer Storage Primary Storage Secondary Storage ...
Read MoreComputer System Organisation
The computer system is a combination of many parts such as peripheral devices, secondary memory, CPU, device controllers, and a shared memory bus. These components work together to execute programs and handle input/output operations. Computer System Organisation The following diagram shows how the CPU, memory, and I/O device controllers are connected through a common system bus − Computer System Organisation CPU Processor Memory RAM Disk Controller ...
Read MoreOperating system time slicing in round robin scheduling
Round Robin (RR) is a CPU scheduling algorithm where each process is assigned a fixed time slot called a time slice (or time quantum). The CPU cycles through all ready processes in order, giving each one the time slice. If a process does not finish within its time slice, it is moved to the back of the queue and the next process gets the CPU. This is one of the simplest and most widely used scheduling algorithms in operating systems, especially in time-sharing systems where fair CPU allocation is important. How Round Robin Scheduling Works The scheduler ...
Read MoreWhat is the difference between time.clock() and time.time()?
The function time.time() returns the time in seconds since the epoch, i.e., the point where the time starts. For Unix and Windows, the epoch is January 1, 1970 (UTC). The function time.clock() was used to measure processor time on Unix and wall-clock time on Windows. However, time.clock() was deprecated in Python 3.3 and removed in Python 3.8. The recommended replacements are time.perf_counter() for wall-clock timing and time.process_time() for CPU time. Syntax import time time.time() # Wall-clock time since epoch time.perf_counter() # ...
Read MoreSByte.GetTypeCode Method in C# with Examples
The SByte.GetTypeCode() method in C# is used to return the TypeCode enumeration value for the sbyte data type. This method is part of the IConvertible interface and helps identify the specific type of a value at runtime. Syntax Following is the syntax for the SByte.GetTypeCode() method − public TypeCode GetTypeCode(); Return Value The method returns TypeCode.SByte, which is the enumeration constant representing the sbyte type. Using GetTypeCode() with SByte Values Example using System; public class Demo { public static void Main() { ...
Read MoreHow to create an OrderedDictionary in C#?
An OrderedDictionary in C# is a specialized collection that maintains the insertion order of key-value pairs. Unlike a regular Dictionary, it preserves the sequence in which elements were added, making it useful when order matters. The OrderedDictionary class is part of the System.Collections.Specialized namespace and provides both indexed access and key-based access to elements. Syntax Following is the syntax for creating an OrderedDictionary − OrderedDictionary dict = new OrderedDictionary(); dict.Add(key, value); dict[index] = value; // Access by index dict[key] = value; // Access by key Creating and Populating an ...
Read MoreQueue.IsSynchronized Property in C#
The Queue.IsSynchronized property in C# is used to determine whether access to the Queue is synchronized, meaning it is thread-safe for concurrent access by multiple threads. Syntax Following is the syntax for the IsSynchronized property − public virtual bool IsSynchronized { get; } Return Value The property returns a bool value − true − if access to the Queue is synchronized (thread-safe) false − if access to the Queue is not synchronized Using IsSynchronized with Regular Queue By default, a regular Queue is not synchronized and returns false ...
Read MoreHow to search in a row wise increased matrix using C#?
Searching in a row-wise sorted matrix is a common algorithmic problem where each row and column is sorted in ascending order. The naive approach of scanning all elements takes O(M×N) time complexity, but we can optimize this using a smart traversal strategy. The key insight is to start from either the top-right corner or bottom-left corner of the matrix. From the top-right position, if the target is smaller than the current element, move left; if larger, move down. This approach eliminates either a row or column in each step. Algorithm The search algorithm works as follows − ...
Read MoreQueue.Peek Method in C#
The Queue.Peek() method in C# is used to return the object at the beginning of the Queue without removing it. This method is useful when you need to examine the first element in the queue without modifying the queue's contents. Syntax Following is the syntax for the non-generic Queue − public virtual object Peek(); Following is the syntax for the generic Queue − public T Peek(); Return Value The method returns the object at the beginning of the Queue. For generic queues, it returns type T, and for non-generic ...
Read More