Skip to main content

Posts

Showing posts with the label arrays

Quick Sort Algorithm using Recursion

Quick sort is one of the most important and widely used sorting algorithm. Quick sort is a very efficient algorithm which if implemented well can run two to three times faster than its competitors merge sort and and heap sort. The algorithm is a divide and conquer algorithm. The algorithm works by selecting a pivot element, this pivot element is usually the first element and choice of the pivot element affects the running time of the algorithm. The algorithm is basically to select a pivot element and then moving all the element less than the pivot element to its left and all the elements greater than pivot element to its right. Then we divide the array into 2 parts, one on the left of the pivot and other on the right of the pivot and then pass these 2 arrays to the algorithm for further sorting. Algorithm : Choose a Pivot element. Take 2 variables left_marker and right_marker excluding the pivot element. Set left_marker as the first element of the array Set right_marker as the...

Data encryption using Caesar Cipher

In this post we will discuss what is cryptography and how can we encrypt our files using Caesar Cipher. First Things first let us first understand the what is cryptography, according to wikipedia, " Cryptography  is the practice and study of techniques for  secure communication  in the presence of third parties called  adversaries" Simply stated it is passing messages between 2 user using a channel that is not secure yet the intruders trying to get steal information will not be able to understand messages directly as the messages are encrypted. In order to encrypt a message, we change the contents of message such that only the intended receiver of the message is able to decode it. Let us now discuss Caesar Cipher, sometime also called as shift cipher is a ciphering technique that is one of the most simple and widely known techniques of encryption. This technique uses a substitution technique in which for each letter in our message we have a letter...