Lower Bound for Comparison Sort
ESO207
Indian Institute of Technology, Kanpur
Overview
We have seen several sorting algorithms so far,
Heapsort, Mergesort and Quicksort.
Heapsort and Mergesort can s
Lecture # 1-2
Dr. Qamar Abbas
Books
C+ Plus Data Structure by Nell Dale, 3 rd
Edition
Data Structures & Algorithms in Java by M. T.
Goodrich 6th Edition
A Practical Introduction to Data Structures and
International Islamic University, Islamabad
Faculty of Basic & Applied Sciences
Department of Computer Science & Software Engineering
Data Structure and Algorithms
Program:BSSE/BSCS Fall-2015
Course C
Lecture # 3-4
Dr. Qamar Abbas
Algorithm
An algorithm is a finite set of steps
defining the solution of a particular
problem.
Need not to belong one particular
language
Sequence of English statements c
DataStructuresandAlgorithms
(ESO207/ESO211)
Lecture2
Time complexity
Big O notation
Solving a problem: Maximum sum subarray
1
Time complexity of an algorithm
2
Example:
Time complexity of matrix multi
DataStructuresandAlgorithms
(ESO207A/ESO211)
Lecture4-5
Heaps
1
Binary tree
The simplest among the tree data
structures (but useful).
Tree has a root node.
10
rootnode
Each node has at most two childr
Hash Tables
ESO207
Indian Institute of Technology, Kanpur
Introduction
Consider a dynamic set that supports dictionary
operations, I NSERT, S EARCH and D ELETE.
Previously, the L IST (and even S TAC
DataStructuresandAlgorithms
(ESO207A/ESO211)
Lecture7
Linked Lists
1
Singly Linked Lists
L
Linkedlistsareelementsarrangedinalinearorder.
5
next
9
next
3
next
15
next
3
NIL
Examplelistwith5elements:(5,
DataStructuresandAlgorithms
(ESO207A/ESO211)
Lecture6
Stacks, Queues
1
Stacks and Queues
We will look at two classical data
structures, Stacks and Queues.
Both model dynamic set of elements, that
is,
Binary Search Trees-I
ESO207
Indian Institute of Technology, Kanpur
Introduction
We will now begin our study of the Search trees data
structure that supports dynamic set operations such as
S EARCH, I
ESO 207
Hints and Solutions: Practice Problems - 2
Devendra Agrawal and Rachit Nimavat
TA, ESO207
September 6, 2014
1. For each half you need to store 4 things, Best Sum of the Half , Best Prex Sum
an
ESO 207
Hints and Solutions: Practice Problems - 1
Devendra Agrawal and Rachit Nimavat
TA, ESO207
September 6, 2014
1.
Find the sum of all numbers in the array , let's call it as Sum_from_Array.
Find
ESO207: Data Structures and Algorithms
Practice Problems 3
Solutions
Practice Problems: Hashing (Sample Solution)
Topics: Hash Tables.
Problem 3-1. [CLRS 11.4-4] Suppose that we use double hashing to
ESO 207
Practice Problems - 2
Devendra Agrawal
Rachit Nimavat
September 2, 2014
1. The maximum subarray problem is to nd the contiguous subarray within a onedimensional array of numbers (containing at
ESO207: Data Structures and Algorithms
Practice Problems 3
Hash tables
Practice Problems: Hashing
Problem 3-1. [CLRS 11.4-4] Suppose that we use double hashing to resolve collisionsthat is, the
hash f
ESO 207
Practice Problems - 1
Devendra Agrawal and Rachit Nimavat
TA, ESO207
August 9, 2014
These are practice problems. They may be discussed in classes and/or solutions to the problems
will be poste
Lecture # 5-6
Dr. Qamar Abbas
Array Operations
Although we can apply conventional operations
defined for each element of an array , there are some
operations that we can define on an array as a data
s