The task is to generate a string that consists of characters ‘a’ and ‘b’ which satisfies the condition mentioned below: str must have a length of A+B. The character 'a' must appear A times and the character 'b' must appear B times within the string. The sub−strings "aaa" and "bbb" should not appear in str. After generating the string, it should be printed. One possible solution is to first generate a string with all 'a's and 'b's, with 'a' occurring A times and 'b' occurring B times. Then, we can shuffle the string randomly until we find a ... Read More
FCFS CPU Scheduling (First Come, First Serve) is a fundamental CPU scheduling mechanism that executes programs in the order they are added to the ready queue. In other words, the first process to come will be carried out first, and so on. Since it uses a non−preemptive scheduling technique, a process that has been allocated to the CPU will keep running until it is finished or enters a waiting state. Scenario 1 Let's take a look at an example to understand FCFS CPU scheduling in more detail. Suppose we have three processes with the following arrival times and burst times: ... Read More
DCL(Data Control Language) work is to deal with sql commands that are used to permit a user to access, modify and work on a database. it is used to access stored data. It gives access, revoke access and change the permission to the owner of the database as per the requirement. It helps in how sql can use a user authority to modify or retrieve data and protect against unauthorised access. It complements data manipulation language(DML) and data definition language(DDL). It is the simplest among the three command It is basically used for enforcing data security. DCL Commands ... Read More
Data replication means copying the data at multiple locations to improve the availability of data. It is used to remove the inconsistency between the same data which results in a distributed database so that users can do their own task without interrupting the work of other users. There are various types of Data Replication in DBMS as follow − Types of Data Replication Transactional Replication It makes a full copy of the database along with the changed data. Transactional consistency is guaranteed because the order of data is the same when copied from publisher to subscriber database. It is ... Read More
Operating system has a concept known as the optimal page size that is affected by a number of variables, such as the system architecture, the amount of physical memory at hand, and the workload of the running applications. Steps/ Approach The following steps can be used to find the ideal page size: Step 1: Establish the system's design:Different CPU designs support varied page sizes. For instance, x86 CPUs typically offer 4KB page sizes, whereas ARM CPUs support 4KB, 16KB, or 64KB page sizes. Step 2: Calculate the physical memory capacity:The ideal page size depends on the physical memory capacity. Larger ... Read More
Data preprocessing is an important process of data mining. In this process, raw data is converted into an understandable format and made ready for further analysis. The motive is to improve data quality and make it up to mark for specific tasks. Tasks in Data Preprocessing Data cleaning Data cleaning help us remove inaccurate, incomplete and incorrect data from the dataset. Some techniques used in data cleaning are − Handling missing values This type of scenario occurs when some data is missing. Standard values can be used to fill up the missing values in a manual way but ... Read More
The goal is to determine the minimum time required to complete the tasks in queue A based on the order of execution in queue B, given two queues A and B, each of size N, where: Pop this task and run it if the task identified at the head of queue B is also at the head of queue A. Pop the current task from queue A and push it at the end if the task discovered at the front of queue B is not also found at the front of queue A. One unit of time is ... Read More
Data Objects Data objects refers to a collection of various attributes which are combined to make it understandable. Data object values have their own unique id, attribute and data types. The most common type is the data table. Data objects are mostly represented in data models, which resolve with the relationship among the data objects. Types of Data Objects Array is a one-dimension data object. i.e, can be a single column in a table. Example Student Name Aman Naman Monu Records Records refers to a single row for every ... Read More
Given are N processes and two N−sized arrays, arr1[] and arr2[]. A process's time in the critical section is recorded in arr1[], and it’s time to finish processing after leaving the critical part is recorded in arr2. The goal is to determine how long it will take for each process to finish processing (both inside and outside of the critical section) in any given order. Input Output Scenarios Assume we have 3 arrays as shown below Input N = 3, arr1[] = {1, 4, 3}, arr2[] = {2, 3, 1} Output 9 The first process, at ... Read More
In this article, you will learn about how to find the order of execution for the given N processes in the Round Robin Scheduling algorithm. But before starting with the code, let’s understand a bit about how this algorithm works. Round Robin Scheduling is a popular CPU scheduling algorithm used in operating systems to allocate CPU time to multiple processes in a fair and efficient manner. In this blog, we will explore how round−robin scheduling works, its advantages and disadvantages, and provide an example to help you understand the concept better. What is Round Robin Scheduling? Round Robin Scheduling is ... Read More