Reverse a Linked List in Groups of a Given Size Using C++

Prateek Jangid
Updated on 29-Nov-2021 10:30:28

288 Views

In this article, we deal with a singly linked list, and the task is to reverse the list in groups of k. For example −Input: 1->2->3->4->5->6->7->8->NULL, K = 3 Output: 3->2->1->6->5->4->8->7->NULL Input: 1->2->3->4->5->6->7->8->NULL, K = 5 Output: 5->4->3->2->1->8For this problem, one approach that comes to mind is trailing the list and reversing the list when our sublist’s size reaches k and continues.Approach to find The SolutionIn this approach, we will generally traverse through the list and keep a counter to count the number of elements in our sub-list. When the counter reaches the count of k, we reverse that ... Read More

Modules Improve Monolithic and Microkernel Approaches

Bhanu Priya
Updated on 29-Nov-2021 10:29:06

216 Views

In an operating system different modules are involved and all these modules perform different tasks at different stages. Modules are the basic structure of an operating system.The modules are designed for performing a specific task and these services are dynamically implemented by all the operating systems and a number of modules are involved.ModulesThe different modules that are involved in operating system are as follows −Scheduling class.File system.Load system.Execute system.Stream class.Device and bus system.Miscellaneous system.These are represented in diagram format below −Modules improve Monolithic and Microkernel approachThe kernel modules are introduced to improve the experience of the user in such a ... Read More

Reverse a Doubly Linked List in Groups of a Given Size Using C++

Prateek Jangid
Updated on 29-Nov-2021 10:27:24

404 Views

In this problem, we are given a pointer to the head of a linked list and an integer k. In groups of size k, we need to reverse the linked list. For example −Input : 1 2 3 4 5 (doubly linked list), k = 3 Output : 3 2 1 5 4Approach to find The SolutionIn this problem, we are going to make a recursive algorithm to solve this problem. In this approach, we are going to use recursion and solve the problem using that.Example#include using namespace std; struct Node ... Read More

What is Microkernel in Operating Systems

Bhanu Priya
Updated on 29-Nov-2021 10:26:21

7K+ Views

Kernel is the main part of an Operating System. It is the first program that is loaded after the boot loader whenever we start a system. The Kernel is present in the memory until the Operating System is shut-down.Kernel provides an interface between the user and the hardware components of the system. Whenever a process makes a request to the Kernel, then it is called System Call.Functions of KernelThe functions of the kernel are as follows −Process managementAccess computer resourcesDevice managementMemory managementInterrupt handlingI/O communicationTypes of KernelsThe different types of kernels are as follows −Monolithic kernel.Micro kernel.Hybrid kernel.Nano kernel.Exo kernelNow let ... Read More

Concept of Monolithic Kernel

Bhanu Priya
Updated on 29-Nov-2021 10:24:37

3K+ Views

Kernel is the main part of an Operating System. It is the first program that is loaded after the boot loader whenever we start a system. The Kernel is present in the memory until the Operating System is shut-down.Kernel provides an interface between the user and the hardware components of the system. Whenever a process makes a request to the Kernel, then it is called System Call.Functions of KernelThe functions of the kernel are as follows −Process managementAccess computer resourcesDevice managementMemory managementInterrupt handlingI/O communicationTypes of KernelsThe different types of kernels are as follows −Monolithic kernel.Micro kernel.Hybrid kernel.Nano kernel.Exo kernelNow let ... Read More

Reverse a Doubly Linked List using C++

Prateek Jangid
Updated on 29-Nov-2021 10:18:03

749 Views

In this article we have a doubly linked list, and we will explain different approaches to reverse a doubly linked list in C++. For example −Input : {1, 2, 3, 4} Output : {4, 3, 2, 1}There is generally one approach that comes to mind, but we will use two approaches − The normal and unorthodox approach.Normal ApproachIn this approach, we will go through the list, and as we go through it, we reverse it.Example#include using namespace std; class Node {    public:    int data;    Node *next;    Node *prev; }; void reverse(Node **head_ref) ... Read More

Advantages and Disadvantages of Different Operating Systems

Bhanu Priya
Updated on 29-Nov-2021 10:15:51

6K+ Views

To begin with, let us understand the advantages and disadvantages of MS-DOS Operating System.MS-DOS Operating systemAdvantagesThe advantages of MS-DOS Operating System are as follows −MS-DOS is a lightweight system and it allows direct access to all hardware with the help of the command line.This operating system is very lightweight.It also does not support multitasking therefore there is less overhead and less latency.MS_DOS boots the system faster than any other operating system.DisadvantagesThe disadvantages of MS-DOS Operating System are as follows −It has a command line user interface therefore it is very less user friendly.Very few applications are supported in DOS.It is ... Read More

What is a System Program

Bhanu Priya
Updated on 29-Nov-2021 10:13:49

24K+ Views

In an operating system a user is able to use different types of system programs and the system program is responsible for all the application software performance of the computer.The system programs are responsible for the development and execution of a program and they can be used by the help of system calls because system calls define different types of system programs for different tasks.File management − These programs create, delete, copy, rename, print, exit and generally manipulate the files and directory.Status information − It is the information regarding input, output process, storage and the CPU utilization time how the ... Read More

Operating System Design Goals

Bhanu Priya
Updated on 29-Nov-2021 10:11:58

2K+ Views

The design goals in operating system are as follows −Concurrent SystemsOperating systems must handle multiple devices as well as multiple users concurrently. It is a must for modern multiple core architectures. Due to these features the design of the operating system is complex and very difficult to make.Security and PrivacyOperating systems must provide security and privacy to a system. It is important to prevent the malicious user from accessing your system and to prevent the stealing of the user programs.Resource SharingOperating system ensures that the resources of the system must be shared in a correct fashion in between multiple user ... Read More

What is the Computing Environment

Bhanu Priya
Updated on 29-Nov-2021 10:09:22

8K+ Views

In computers there are different types of computing technologies and all are different from each other. By using this we are finding output based on the input given by the user.In a computing environment the user can use a particular computing technology and it is responsible for all the types of input and output given by the computer.The different numbers of computing technologies that are used in OS are as follows −Traditional computingIn traditional computing the user can use a traditional method like static memory allocation and it is mainly useful in single user operating systems.In this technique there will ... Read More

Advertisements