Introduction Copying data structures such as lists is a frequently performed task in computer programming. For instance, one of the most efficient sorting algorithms is merge sort. Merge sort uses divide and conquer approach to split the unsorted list into two sections in a recursive fashion. To do so, merge sort uses list copying technique.
Introduction Modern operating systems support multitasking via CPU time sharing. The operating system manages CPU time by implementing a scheduling algorithm. In this article, we are going to briefly discuss round robin scheduling algorithm. To better understand the topic, you may check the following posts… Multitasking terms Scheduling algorithms Evaluate a scheduling algorithm Let us
Introduction In this Python code snippet, we are going to implement an easy hangman solver using simple source code. The game code is adapted to work with both Python 2.x and Python 3.x. The example provided is a console based application for beginners. Let us get started with the tutorial… Python 2.x program There is
Introduction Ready for more code snippets? In this post, we are going to talk about random numbers in Python. Have you ever thought about what random means or even if randomness makes any sense in the context of computing! (as computers execute instructions blindly). Is randomness useful? can we apply it in real life computational
Introduction Unicode is an important topic in computing but it is a little bit confusing. In particular, it can be more confusing in the context of Python programming language. For that reason, the aim of our article today is to clarify the ambiguity and hopefully put things into perspective. Beginners may get confused because they
Introduction It is hard (even impossible) to find a real world application not using string comparison. It can be used in database lookup, searching for files on disk, sorting contacts and many other scenarios. String comparison in Python is not hard as we will demonstrate in today’s code snippets. Let us get started… Python string
Introduction Today, we are going to discuss how to convert numbers to strings and visa versa. It is a straightforward Python topic but it is important as well. There are various real life scenarios where type conversion is required. Before elaborating more, let us mention two example use cases to get a taste of what
Table of contents Introduction What is a regular expression? What is Python raw string? Python RE module Python regular expressions syntax summary Regular expressions flags re.match re.search Why use re.match? Regular expression compilation re.match and re.search examples re.fullmatch Match objects re.findall re.finditer re.split re.sub Summary References Introduction Welcome to a new Python code snippets post.
Introduction Welcome to a new operating systems post. Today, we are going to clarify the difference between swapping and paging. The goal is to focus on the main difference between the two and see why is it sometimes confusing. Let us give it a try… Modern operating systems support multitasking and virtual memory. I recommend
Introduction In computer systems, competition on limited resources such as CPU, drives, printers, database records, etc. requires proper synchronization otherwise, undesired effects may arise. In today’s operating systems post, we are going to talk about deadlocks and starvation when a process or thread hangs up but never stop or finish the intended task. The primary