Aditya Chatterjee's Blog, page 123
January 26, 2022
Linux threads: cancellation, data and cleanup
A thread is the basic unit of processor utilization that consists of a program counter, stack and registers. In this article we discuss how they are cancelled, how data is handled within threads and cleaning up to prevent memory leaks when a thread terminates or is cancelled.
Table of contents.Introduction.Cancelling a thread.Thread data.CleanupSummary.References.Prerequisites.Linux processes: listing, creation, schedulingLinux processes: signals, termination, zombies, cleanupLinux ...Compiler Architecture
In this article, we discuss compiler architectures based on two important aspects defining a compiler's architecture, these are, the granularity of data passing through the compiler and the flow of control between compiler modules, we have also gone over the properties of a good compiler and the generated code, portability and retargetability in compiler design.
Table of contents.Introduction.Compiler width.Flow of control.Properties of good compilersProperties of generated code.Portabili...Interpreters (Recursive & Iterative) in Compiler Design
In this article we discuss a machine and paradigm-independent processing of intermediate code by recursive and iterative interpreters.
Table of contents.Introduction.Interpreters.Recursive Interpreters.Iterative Interpreters.Summary.References.Introduction.Processing intermediate code involves choosing between little preprocessing which is followed by execution on an interpreter or a lot of preprocessing(machine code generation) followed by the execution of the generated code on the ha...
January 25, 2022
Dynamic Programming on Trees
In this article, we have explored the idea of Dynamic Programming on Trees in depth and presented some practice problems.
Table of contents:
Dynamic Programming on TreesHow to identify DP on Trees?Practice Problems on "Dynamic Programming on Trees"Pre-requisites:
Introduction to Tree Data StructureIntroduction to Dynamic ProgrammingBasic Problems using DPDynamic Programming on TreesDynamic Programming is the technique of utilizing the answer of smaller problem set to find the answer o...
Introduction to Tree Data Structure
In this article, we have presented a detailed introduction to Tree Data Structure. This will quickly give you the idea of Tree, how it is implemented and the different types that are used.
Table of contents:
What is Tree Data Structure?Generalization of TreeImplementation of Tree Data StructuresTypes of TreesPre-requisites:
Array Data StructureBinary TreeGraph Representation: Adjacency Matrix and Adjacency ListDifferent Self Balancing Binary TreesWhat is Tree Data Structure?Tree Dat...
January 24, 2022
Linux processes: signals, termination, zombies, cleanup
A process is a running instance of a program, it starts when a command is executed. In this article we discuss various process management concepts such as signals and how they are utilized, how a process is terminated, wait system calls, zombie processes and how they are cleaned.
Table of contents.Introduction.Signals.Process termination.Waiting for process terminationZombie processes.Asynchronous cleanup.Summary.References.Prerequisites.Linux processes: listing, creation, schedulin...Linux processes: listing, creation, scheduling
A process is a running instance of a program, it starts when a command/program is executed/started. In this article we discuss various process manipulation functions and their implementation in the Linux system.
Table of contents.Introduction.Listing processes.Creating processes.Scheduling processes.Summary.References.Introduction.A process is a running instance of a program, i.e running having two terminals open means running two terminal programs. These terminals might each run a she...
Partitioning in Linux
In this article, we discuss the concept of partitioning a drive, naming conventions for Linux partitions, types of partitions and demonstrate how to partition a drive in Linux using parted utility.
Table of contents.Introduction.Naming conventions.Types of partitions.Partitioning process.Summary.References.Prerequisites.Linux file hierarchyLinux file systemIntroduction.Partitioning a disk is the first step before installing a file system since creation of any files or directories ...
Linux piping and redirection
In this article we discuss piping and redirection whereby we can alter the flow of input or output streams. This technique enables a user to create custom commands by combining multiple smaller commands to achieve specific task that cannot be accomplished by a single Linux command.
Table of contents.Introduction.Creating files.Redirection.Piping.Summary.References.Introduction.Streams are inputs to and outputs from a program in Linux, we can redirect these streams.
Like everything else...
January 23, 2022
Find starting point of loop in linked list
In this article, we have explored three different algorithmic techniques to find starting point of loop in linked list.
Pre-requisites:
Hash SetLinked ListContents
IntroductionMethodsUsing HashSetMarking NodeFloyd's (Tortoise and Hare) AlgorithmIntroductionYou may know that every Node in a Linked List has two fields, one to store a value and one to point to another node, and this continues until a Node points to the Null Value.
Instead of pointing to the Null Value, the ending N...