C Codes

Printing 1 to N in Binary Using Queue

One of the popular interview question asked on queue data structure: Write a program to print the numbers from 1 to N in Binary Representation using QUEUE data structure. Example: Input: N = 3 Output: 1, 10, 11 Input: N= 5 Output: 1, 10, 11, 100, 101 Code will follow the following Logic: Initialize queue… Continue reading Printing 1 to N in Binary Using Queue

General Discussions

XEN – SEDF and Credit Schedulers

Originally posted on PH Bytes:
This post gives the brief of two schedulers present in Xen. Credit Scheduler Credit scheduler has three states: OVER – gone over the credit allocation UNDER – credits remaining BOOST – to achieve low I/O response latency When sum of the credits for all of the domains go negative all…

General Discussions

Storytelling and Programming

Story telling is an art. Essentially, every plot is a collection of emotions. Conflicts build curiosity. There are some constraints. Some factors, some environment, some of characters, all working towards the end goal, which in most case is – ‘happily ever after’. With programming now being and becoming a household thing, is no lesser than… Continue reading Storytelling and Programming

General Discussions

Algorithm for a Self-Creating Algorithm

We have advanced so much with data science, machine learning and artificial learning that sometimes I really wonder if writing an algorithm would makes sense. With changing data, algorithm turns out to be highly dynamic and difficult to predict how it might behave after certain point of time if we are not aware of type… Continue reading Algorithm for a Self-Creating Algorithm

General Discussions

Why File Pointers are of type FILE

When working with files in C programming language, we define and use a file pointer of data type FILE. For say example we use: FILE *out_file; One could always have a question, that, why use FILE? From where is that data type suddenly popped out? The reason being that C header files have a structure… Continue reading Why File Pointers are of type FILE