Lecture # 7: Introduction to Graph Theory

Graphs: A pictorial representation of objects (Nodes) connected by links (Edges) is called a graph. A graph is a set of Nodes and Edges. A node is an object linked to other objects by edges. Edges are the connection or links between the Nodes. Edges can be single directional or bi-directional, single directional edges are shown … Continue reading Lecture # 7: Introduction to Graph Theory

Lecture 6: Probabilistic Analysis for Randomized Algorithm

Probabilistic Analysis:  Probabilistic Analysis is the use of probability in the analysis of problems. Most commonly, we use probabilistic analysis to analyze the running time of a randomized algorithm. Randomized Algorithms: Randomized Algorithms are those algorithms that either contain a random input or probability is used in the algorithm. Goal:  Our goal in these types of … Continue reading Lecture 6: Probabilistic Analysis for Randomized Algorithm

Lec#5 Counting Sort and Bucket Sort

Counting’ Sort:             Assume that we are given an array A=[a1,a2,a3,……..an], where k ≥ ai ≥ 0 and K is the max number in this array. The main fact about this sort that there is no comparison in it. Algorithm: 1.      Make a new array of size k, which is the max number in that array. Let new array is … Continue reading Lec#5 Counting Sort and Bucket Sort

Lecture 4: Types of heaps,heap sort and decision trees

There are four main functions associated with heapsort 1.Fix function: In the fix function, compare that node with its children. If in a min-heap, swap the parent and the smallest child considering that the child is smaller than the parent itself. Continue if the parent is smaller than both children, else terminate the function.In a … Continue reading Lecture 4: Types of heaps,heap sort and decision trees

Lecture 3: Divide and Conquer Continued

Questions about rank problemQ1: In our rank problem, we made chunks of size 5. What if we have a chunk (usually the last one) which has less than 5 elements? Will this effects our solution?Ans: There are two approaches to this problem1: place dummy element of huge size in the last chunk so that all … Continue reading Lecture 3: Divide and Conquer Continued