How to Implement Singly Linked List in C?

What is singly linked list? In computer science, linked list is a collection of data elements, also called nodes, which are connected or linked by means of pointers or references. Connected or linked means if you have access to an element, you can go to the next element. In Singly linked list the links are unidirectional. … Continue reading “How to Implement Singly Linked List in C?”

How to Access MySQL Database from C Program?

MySQL is an open sourcce database management system (DBMS). It is very popular among the web developers as it is part of LAMP (Linux, Apache, MySQL, PHP/Perl/Python) stack. Many popular large scale websites like WikiPedia, Facebook, Youtube use this database. Many times we need to use access MySQL database from C program. Here we’ll see … Continue reading “How to Access MySQL Database from C Program?”

SQL Query to Find Second Highest Salary

Finding second highest salary from an employee table using SQL is a classic problem the job seekers often face as their interview question. Database programmers also have to solve similar problem like finding Nth highest number from a table. Finding the maximum salary from an Employee table is very trivial but finding second highest is bit … Continue reading “SQL Query to Find Second Highest Salary”

How to Implement Periodic Timer in Linux

In this article we’ll see how to implement periodic timer in Linux using C programming language. We’ll first create a timer library that will be used to create one or more timers. Timers can be periodic or single shot. You’ll be able to use this timer library in your own program to create one or multiple timers. … Continue reading “How to Implement Periodic Timer in Linux”

Loop in Linked List, C Program to Detect and Remove

What is loop in linked list? Loop in linked list means you can traverse the list endlessly. If you traverse a linked list with loop, you will hit all or some of the nodes again and again. We’ll see how this is possible. Consider the normal (without loop) linked list above. Head points to the … Continue reading “Loop in Linked List, C Program to Detect and Remove”

C Program to Sort Linked List without Allocating Extra Memory

We’ll first create a linked list which is not sorted, then we’ll re-arrange the list such that the list becomes sorted. Logic is simple, we’ll iterate the list for all nodes, in every iteration we’ll take the first node out of the original list and insert that node into a new list. At any point … Continue reading “C Program to Sort Linked List without Allocating Extra Memory”

How to Protect Android Smartphone from being Stolen

Today’s smartphones are not used only to make voice calls and exchanging SMS(es), they are full-fledged computers. Today we use smartphone for various other purposes like email communication, social networking, banking, entertainment and many more. Most of the time you remain logged-in in various accounts like email, Skype, Facebook etc. Loosing your phone can become a … Continue reading “How to Protect Android Smartphone from being Stolen”

C Program to Convert Binary Number to Decimal

Binary number system is 2-based which means at most two symbols, 0 (zero) and 1 (one), can be used to represent a binary number. Example of binary number is 110110011, sometimes binary numbers are written as 1101100112, where 2 is represented as base of the number system. Binary number system is the basis of all computer and digital systems. … Continue reading “C Program to Convert Binary Number to Decimal”

What is Secure Copy (SCP)?

Secure Copy (SCP) is a mechanism that allows us to transfer files (or folder) between a local and a remote host or between two remote hosts. It refers to two things, 1) Secure Copy Protocol, 2) Secure Copy (scp) Command. Secure Copy (SCP) is an application level networking protocol that supports file transfer in secure … Continue reading “What is Secure Copy (SCP)?”

Compilation Error, Linking Error and Run Time Error

All these types of errors refer to different stages of program’s lifetime. To understand these errors, we have to understand the stages of a program’s lifetime. Generally the programs are written in high level programming languages like C or Fotran which is referred as source codes. Source codes are human readable text that are written in English … Continue reading “Compilation Error, Linking Error and Run Time Error”