Remove First Node of the Linked List using C++

Prateek Jangid
Published on 26-Nov-2021 11:17:45
Given a linked list, we need to remove its first element and return the pointer to the head of the new list.Input : 1 -> 2 -> 3 -> 4 -> 5 -> NULL Output : 2 -> 3 -> 4 -> 5 -> NULL Input : 2 -> ... Read More

What is the locality of reference?

Bhanu Priya
Published on 26-Nov-2021 11:02:38
Locality of reference refers to the tendency of the computer program to access the same set of memory locations for a particular time period. The property of Locality of Reference is mainly shown by loops and subroutine calls in a program.On an abstract level there are two types of localities ... Read More

What is memory hierarchy?

Bhanu Priya
Published on 26-Nov-2021 11:00:09
Memory hierarchy is based on storage capacity, speed, and cost.As capacity increases, applications grow to use it.Need for speed to keep up with the improvement in CPU speed.Higher the storage capacity, lesser the speed, and lesser the cost per bit.The level of hierarchy is shown below −Level-0 − RegistersThe registers ... Read More

What are the interrupt stages and processing?

Bhanu Priya
Published on 26-Nov-2021 10:56:42
Instruction cycle consists of fetch, execute and interrupt stage show in below diagram −If any interrupt occurs, it is indicated by an interrupt flag. The CPU will go to interrupt handler routine. Interrupt handler then checks the type of interrupt and executes the appropriate function. It involves overhead but still ... Read More

What is an interrupt and how does the processor handle normal and multiple interrupts?

Bhanu Priya
Published on 26-Nov-2021 10:55:01
An interrupt is a signal from a device attached to a computer or from a program within the computer that requires the operating system to stop and figure out what to do next.Whenever an interrupt occurs, it causes the CPU to stop executing the current program. Then comes the control ... Read More

Remove Every K-th Node Of The Linked List

Prateek Jangid
Published on 26-Nov-2021 11:07:54
In this article, we will explain the way to remove every k-th node of the linked list. We must delete every node that sits on the multiple of k, i.e., we have to delete the node on positions k, 2*k, 3*k, etc.Input : 112->231->31->41->54->63->71->85    k = 3 Output : ... Read More

What is primary and secondary memory?

Bhanu Priya
Published on 26-Nov-2021 10:49:10
Memory is a storage part in a computer system. It is used to store the data, information, and programs at the time of processing on the computer. It stores data either temporarily or permanent. The main use of memory is saving and retrieving data.Types of MemoryGenerally computer system consists of ... Read More

What are the basic elements of computers related to OS?

Bhanu Priya
Published on 26-Nov-2021 10:45:58
We know that an operating system is a resource allocator and it manages all the resources which are associated with the system.Let us see how operating system design is related to basic elements of a computer systemRegistersRegisters are available in the processor. These registers are used for storage and data ... Read More

What is an instruction set in a computer?

Bhanu Priya
Published on 26-Nov-2021 10:44:24
An instruction is a set of codes that the computer processor can understand. The code is usually in 1s and 0s, or machine language. It contains instructions or tasks that control the movement of bits and bytes within the processor.Example of some instruction sets −ADD − Add two numbers together.JUMP ... Read More

What is the purpose of a register in a CPU and what are special purpose registers?

Bhanu Priya
Published on 26-Nov-2021 10:42:52
A CPU register is a small and temporary storage containing a set of data holding places that are part of the computer processor. A register holds an instruction, a storage address, or any kind of data.Before trying to understand some special purpose registers, let us try to understand the difference ... Read More
1 2 3 4 5 6 7 ... 5904 Next