Introduction The purpose of this short post is to explain operating system’s page table vs inverted page table, mention their advantages and disadvantages in an easy to follow manner. Many students and beginners do not get the point behind these two concepts so my intention here is to clear any possible confusion rather than dive
Introduction I highly recommend that you check out the following article to get a quick idea about different terms used in operating systems with regard to concurrency, multitasking and threading. Back to our topic, In this short post, I am going to demonstrate the use of mutex in python. Let us get started. What on
Introduction Finding differences between two terms may imply that we are aware of what each individual term stands for yet the purpose of comparison is just seeking a better way of understanding. I think that is true to some extent however I also noticed that there are people who ask the “difference between x and
This is a commonly asked question that sadly confuses many computer science students. Confusion comes from the fact that the literal meaning of the two terms is very close. Also, the historical context of the two terms does not help much as different people use the terms differently. In this post I am going to
Introduction The distinction between regular and static variables in C++ is a such a confusing topic for many beginners including students and programers. In this short article, I am going to provide an brief explanation and hopefully remove the ambiguity. I personally believe that the root cause of confusion is due to lack of context.
Syntax The power function in Python can be easily computed by importing the math module as follows: You can alternatively use the ** syntax as follows: Modular Exponentiation The power function can also be used as: This is called modular exponentiation which is useful in some computer science applications especially public key cryptography, for example:
Introduction Any computer algorithm requires two control flow structures: iteration and selection. Our topic today is mainly about iteration using the Python for loop. The goal of this post is to achieve three objectives: Provide a beginner introduction to the for loop control structure Include example code snippets for copy and paste lovers Cover some
Amicable Numbers Definition Two positive integer numbers (m, n) are amicable if the sum of the proper divisors of (m) is equal to (n) and the sum of the proper divisors of (n) is equal to (m). A proper divisor of a number does not include the number itself. For example, the proper divisors of
Problem Given the signature of the method below. It receives a two dimensional array of strings. Provide implementation that iterates through each string in each sub-array in the order they are provided but it skips null values Solution We are dealing with a two dimensional array of strings so we need a proper way to
Problem Given the Java method signature below. It receives an array of string iterators. The method should return a single string iterator that chains all iterators in order skipping null values Solution We wrap the array of iterators in a list that implements the iterable interface and override the hasNext, next and remove methods. hasNext: