A Simple Explanation of Rabin-Karp Algorithm For String Search

Introduction If you are new to string search, I would recommend to first read the brute force approach here. Brute force as discussed in the mentioned post has time complexity of O(mn) in worst case. Rabin-Karp also has the worst case time complexity of O(mn), but it has a much better time complexity of O(m... Continue Reading →

A complete tutorial on Binary Tree

Introduction   Figure 1 shows a Binary Search Tree. This post will start with the motivation of studying BST and gradually move to the related definitions. We will do some hands on coding for simple BST operations and we will end the post by analysing the drawbacks. Where do we use Binary Search Tree? Trees... Continue Reading →

Network Flows – Maximum Flow

Network flows is a class of problems dealing with directed graphs and the properties of functions defined on the graph. Flow Flow represents any element which does not disappear while traveling through the edges of the directed graph. Flow can be current in the electric network, data packets in case of the computer network and... Continue Reading →

Binary Heap – Data Structure

Usage In Heapsort In Priority Queue Not the garbage collector storage (as provided by JVM) Definition A binary Heap is an array object. We can view that array object as a near complete binary tree. A binary tree is said to be a complete binary tree when all the nodes except possibly for the leaves... Continue Reading →

Blog at WordPress.com.

Up ↑