Programming
In this Blog, we going to learn about GitHub commands and their purpose. Every programmer should have a piece of good knowledge of GitHub commands. Here I listed some of the most important commands for programmers for their day-to-day use. git init Initialize the project folder as a git repository. git clone <HTTP link or […]
I thought sharing some code for accessing word from in little & big endian ways will be helpful for someone. get_word() implementation: int get_word(int address) { int i = address — from; //From is the start address of memory in the Linear Address Space if (CONSTANTS.BIG_ENDIAN) { return (((int) memory[i] << 24) | (((int) memory[i […]
How insertion sort works? Insertion sort is a simple sorting algorithm that builds the final sorted array (or list) one item at a time. It works best on a nearly sorted list. It has the following characteristics Stable; i.e., does not change the relative order of elements with equal keys In-place; i.e., only requires a […]
Problem statement: A binary array sorted in decreasing order is given. We need to count the number of 1’s in it. Examples: Input: arr[] = {1, 1, 0, 0, 0, 0, 0} Output: 2 Input: arr[] = {1, 1, 1, 1, 1, 1, 1} Output: 7 Input: arr[] = {0, 0, 0, 0, 0, 0, […]
What TDD (test-driven development)? Test Driven Development (TDD) is software development process, where requirements are converted to test cases first and implemented later. In simple terms, automated test cases for each functionality are created and tested first. The added test cases obviously fails, then we implement the functionality to pass the test case. Why TDD? Developer […]
Why to use cache in a web application? We know that the dynamic data received on web application is an extension to the static websites, which used to serve only static file over HTTP protocol. When we send dynamic web page each time a user requests, the server does lot of computation in generation of […]
What is a Data Structure? We will not be talking about data structures implementation in this post, but about their usage or choice during programming. As usual lets start from the basic definition. Data Structure is a particular way of storing and organizing data in a computer so that it can be used efficiently. They […]
We all know about the standard comparison based sorting algorithms and their time/space complexity. Algorithms like bubble sort, insertion sort, selection sort, quick sort, merge sort, Heap sort operate with a asymptotic lower bound of O(n log n). Also, other unconventional sorting algorithms like Bucket Sort, Counting Sort, Radix Sort run in O(n) We will not talk […]