Data Structures using C

Lately I have been implementing the standard Data Structures in Computer Science using the C Programming Language. These have the minimal functions to demonstrate the basic usage.

Going forward I will be adding more and also try to explain these.

As of now the list includes:

In the Binary Search Tree program the delete node functionality hasn’t been implemented fully.

The basic algorithm has been presented though which is as follows:

Algorithm to delete a Node from Binary Search Tree (BST)

1. Find the Node in the BST.
2. If Node is a Leaf, then go ahead and delete it.
3. If not find the “in-order successor / predecessor”. Say we use the in-order successor Node_S.
4. Swap the node with Node_S. Now delete Node_S and if it has any children then update the pointers.

For Step 3 we can find wither the minimum node in the right sub tree or the maximum node in the left sub tree.

A simple QuickSort Program in Java

Introduction to Quick Sort

QuickSort algorithm is based on the Divide and Conquer Approach.

For a given sequence S there are 4 basic steps involved:

  • Pick a number X from S. This program picks the last element.
  • Create two Lists. One list will store elements less than X and the other will store greater than X.
  • Sort the two lists recursively.
  • Combine the left list elements with X and the right list elements.

The program below sorts a sequence of Integers. After which another version has been provided which can be used to sort a sequence of characters.These are my own versions of the QuickSort Algorithm.

Continue reading “A simple QuickSort Program in Java”

Learn how to create different versions of your App like Free and Paid

Android framework makes it quite easy for you to generate different flavors and variants of your App. Like you can create a free version or a paid version of your App.

In order to do this you need to follow these steps:

You need to specify the variants or flavors in your App’s build.gradle file.


productFlavors {
    demo {
        applicationId "com.edocent.demo"
        versionName "1.0-demo"
    full {
        applicationId "com.edocent.full"
        versionName "1.0-full"

In all likelihood your Free App version will need a different Activity compared to the Paid one. So you need to create different folders for the two flavors.

So go to the Project->src folder and create a new Java Folder – free.

Create another one for paid similarly.

Add appropriate Activity and other files to this folder.

And you are all set. Execute Generate Signed APK task from the Build option. This will ask you which flavor you need the APK for.

Cool isn’t it.

Source code is available here

Now a wearable device to help you change your Habits !!

If you are like me then you might have a tendency to bite your nails, pull your hairs or keep doing something which you want to get rid off. Problem in such cases is awareness.

Soon you might be able to tame these habits using a wearable device. HabitAware has created a device called Liv.

A smart bracelet that creates awareness of subconscious behaviors like hair pulling, nail biting, skin picking and thumb-sucking in older children.

Willingness to change is the first step. Awareness is the second. Liv helps with this second step.

Learn how to generate a signed APK file

All Android Apps must be digitally signed before they are installed on a device.

This is required to verify identity of developer who published it. And also to verify if it has been tampered.

Follow the video to generate the signed APK file and also to learn how to automate the process.