Simulation of Memory Allocator Module
Posting date: 6/March/14
Submission date: 19/March/14 by 10pm
Demo: 20-24th March/14
Total: 20 Marks
Write a C/C+ program to allocate memory to the processes from the list of available memory
Graph - 3
Single-source (single-destination). Find a shortest
path from a given source (vertex s) to each of the
Single-pair. Given two vertices, find a shortest path
between them. Solution to sing
What is C+ ?
C+ is a Object oriented programming
language. Initially named as C with
C+ was developed at AT & T Bell
C+ is superset of C.
Three important facilities are added
What is a PRIORITY QUEUE?
Queue that gives access ONLY to the MINIMUM item
Items ARRIVE in ANY order
Items EXIT in MINIMUM order
Priority Queue as an Abstract Data Structure
A priority queue is least-first-out
Balanced Binary Trees
What are they?
A redblack tree is a data structure which is a
type of self-balancing binary search tree.
Their relation to 2-4 trees (B-trees of
2-4 trees are search Trees (but not binary
Graph - 2
Minimum Spanning Trees
Some Graph Operations
Given G=(V,E) and vertex v, find all wV,
such that w connects v.
Depth First Search (DFS)
preorder tree traversal
Breadth First Search (BFS)
level order tree traversal
Graph - 1
Material taken from Fundamentals of Data
Structures in C, Ellis Horowitz and Sartaj Sahni
A graph, G=(V, E), consists of two sets:
a finite set of vertices(V), and
a finite, set of edges(E), may possibly be empty
Formally define Data structure as:
DS describes not only set of objects but the
they are related,
the set of operations which may be applied to the
elements of data object.
Example: INTEGER data structure con
Different kinds of list
Commonly used variation of lists are:
A stack is a data structure that works like a
stack of items, such as pile of plates in
Items can be placed onto top of the stack
What is a B+ Tree
A B+ tree is a balanced tree in which every path from
the root of the tree to a leaf is of the same length.
Each non-leaf node of the tree has between [n/2] and
[n] children, where n is fixed for a particular tree.
It contains in
Multi-Way Search Trees
Multiway Search Trees
An m-way search tree is a tree in which, for
some integer m called the order of the tree,
each node has at most m children.
If n <= m is the number of children of a node,
then it contains exactly n-1
Brief Notes on C
Structure of C program
/for input/output functions
#define const_name value
cfw_ /* each declarations and
statements are separated by
semi colon */
Inheritance : Extending classes
C+ strongly supports the concept of
C+ classes can be reused by creating
new classes and reusing the properties of
New class can be derived from an old
class. It is called inheritance.
Features of OOP
Emphasis on data rather than
Programs are divided into objects.
Data structures are designed such
that they characterize the objects.
Functions that operate on the data of
an object are tied together in the data
Assignment 1 (Total marks 13+2) : Here 2 marks are reserved for well documented and
correct program for all kinds of inputs data.
Last date of submission: 22nd Jan by 5pm ; Last date for Demo : latest by 25th Jan
(5) Write complete program in C / C+ to im
The stack controller is a device which when given an input either accepts the
input or rejects it. Internally the stack controller maintains a
set of rules,
lookup table generated from the set of rules.
There are only two kinds
CSL 201, IIT Delhi
Assignment 4 - Part I
Searching Points in a one dimensional(1-D) range
Announce Date : 04.04.2014
Due Date : 12.04.2014
This part of the assignment is based on one dimensional(1-D) range search.
1-D range searches ar
CSL 201, IIT Delhi
Assignment 4 - Part III
Searching Points in Multi-dimensional Range
Announce Date : 12.04.2014
Due Date : 21.04.2014
This part of assignment is based on multi dimensional range search. The
following sections contain brief introduction t
Introduction - Data structure
Data structures in computer science deal with
the problem of structuring or
organizing data in computer so that it can be used
efficiently and processed by algorithms.
To a certain extent, dat
What is a Good Algorithm?
Efficiency as a function of input size:
The number of bits in an input number
Number of data elements (numbers, points)
Measuring the Running Time
Threaded Binary Tree
Threaded Binary Trees
Two many null pointers (n+1) in current
representation of binary trees
n: number of nodes
number of non-null links: n-1
total links: 2n
null links: 2n-(n-1)=n+1
Replace these null pointers with some useful
Tries Lexicographical Search
Name comes from middle letters of
word retrieval, rhymes with pie
Represents strings of any type such as
Each path from root to a leaf is one
To avoid confusion, can use endmarker
Balanced binary tree
The disadvantage of a binary search tree is
that its height can be as large as N-1
This means that the time needed to perform
insertion and deletion and many other
operations can be O(N) in the worst case
We want a tree with