Optimal Binary Search Trees
Problem
Given sequence K = k1 < k2 < < kn of n sorted keys,
with a search probability pi for each key ki.
Want to build a binary search tree (BST)
with minimum expected search cost.
Actual cost = # of items examined.
For k
Red-Black Trees
Balanced binary search trees guarantee an
O(lgn) running time
Red-black-tree
Binary search tree with an additional attribute for its
nodes: color which can be red or black
Constrains the way nodes can be colored on any path
from the ro
External sorting
Why sort?
Users usually want data sorted
Sorting is first step in bulk-loading a B+ tree
Sorting useful for eliminating duplicates
Sort-merge join algorithm involves sorting
Banana
Apple
Grapefruit
Banana
Apple
Blueberry
Orange
Grapefruit
T-Trees
Terminologies
There are three different types of T-nodes.
A T-node that has two sub-trees is called an internal node.
node
A T-node that has one NIL child pointer and one non-NIL child pointer is called a half-leaf node.
node
A T-node that has
Splay Trees and B-Trees
Self adjusting Trees
Ordinary binary search trees have no balance
conditions
what you get from insertion order is it
Balanced trees like AVL trees enforce a
balance condition when nodes change
tree is always balanced after an i
Laboratory Module 6
Red-Black Trees
Purpose:
understand the notion of red-black trees
to build, in C, a red-black tree
1 Red-Black Trees
1.1 General Presentation
A red-black tree is a binary search tree with one extra bit of storage per node: its color,
Language Design Principles
The language design problem
Language
design is difficult, and
success is hard to predict:
Pascal a success, Modula-2 a failure
Algol60 a success, Algol68 a failure
FORTRAN a success, PL/I a failure
Conflicting
advice
Effici
First and Follow Sets
Grammar
ETX
X+E
X
TintY
T(E)
Y*T
Y
First Set
First(a)=setofterminalsthatstartstringofterminalsderivedfroma.
Applyfollowingrulesuntilnoterminalorcanbeadded
1. IftT,thenFirst(t)=cfw_t.
2. IfXNandXexists(nullable),thenaddtoFirst(X).
REMOVING LEFT RECURSION
AND INDIRECT LEFT
RECURSION
DEFINITIONS
IMMEDIATE LEFT RECURSION. A
production is immediately left recursive if its left
hand side and the head of its right hand side are
the same symbol, e.g. B Bvt
A grammar is called immediately
Syntax
Introduction
Syntax is the structure of a language, i.e., the form
that each program or source code file must take.
Since the early 1960s, syntax has been given as a
set of grammar rules in a form developed by Noam
Chomsky, John Backus, and Peter N
Names, Bindings, Scopes, Types
The Concept of Variables
What do x = 1 ; and x = x + 1; mean?
= is not the equal sign of mathematics!
x=1 does not mean x is one !
x is the name of a variable; refer to a variable
A variable is an abstraction of a
memor
!#"%$'&(!)*(",+-!#"./0+#)*1&(32546()*87
9#",;:0<=?>#+)*)3+@
C
J
A
B
CEDGFHDIHCKJ
ILDM
ANDGO
B
I
B
B
P
QR)S%G!">RT("U=V&;+"W>#W+#>#3=!
>#+)*)3+
+#@ FYX'OMPWX Z\[]!3=W+K=!
>#+)*)3+?;T"WS^`_a_abQcd^5e0fbhg5i
&! jW(kRV!"a=W+-*=W%;S"l!">#&!V10:0W!#"nm B m\o9
fo
.in
rs
de
ea
yr
Lecture hours 42 , notes, slides : 398
www.myreaders.info/ , RC Chakraborty, e-mail rcchak@gmail.com , Aug. 10, 2010
http:/www.myreaders.info/html/soft_computing.html
ab
or
ty
,w
w
w
.m
Soft Computing : Course Content ,
R
C
C
ha
kr
www.
INTRODUCTION TO PROBABILITY AND STATISTICS
Conditional probability and independent events.
1. A fair die is tossed twice. Find the probability of getting a 4, 5, or 6 on the rst toss and a
1, 2, 3, or 4 on the second toss.
2. Find the probability of not g
Physics Lab-II
Experiment No. 3
Object: (1) To measure resistivity of semiconductor at different temperatures by Four
Probe Method.
(2) To determine Band Gap of the semiconductor.
Apparatus Used: The Four Probe Set-Up (Model DEP-03 # 70) consists of the
f
Physics Lab-II
Experiment No. 2
Object: To study the Magnetostriction in metallic rod with the help of Michelson
interferometer arrangement.
Apparatus Used: He-Ne Laser with adjustable stand, Magnetostriction set-up with
mechanical and optical components
Experiment Number 5
Specific charge (e/m) by Thomsons method
AIM - To determine the value of specific charge (e/m) of an electron by Thomsons method.
APPARATUS Filament current supply, Deflection plates voltage supply, Continuously
variable accelerating v
FIBER OPTICS
EXPERIMENT NO.6
Experiment No.6 (a)
Objective/Aim: To determine the numerical aperture of a given multimode optical fiber.
Apparatus used: Laser diode with power supply, microscope objective (MO), V grooves
with fiber holder, detector, multim
Physics Lab-II
Experiment No. 1
Object: To determine the band gap in a semiconductor using its p-n junction diode.
Apparatus required: p-n junction diode kit, electrical oven, and thermometer.
Formula used: The reverse biased current Is (saturated value)
Electron specific charge (e/m) by Magnetron method
Aim- To determine the value of specific charge (e/m) of an electron by Magnetron method.
Apparatus- Diode valve, solenoid, and Magnetron setup.
Formula Used- The specific charge of an electron is given by
EXPERIMENT NO. 10
Object: Study of dielectric (constant) behavior and determination of Curies temperature of
ferroelectric ceramics.
Apparatus:
Sample of barium titanate (BaTiO3), apparatus that includes probe arrangement, sample,
oven, oven controller an
Fuzzy Logic and Neural Network
Tutorial-2
1) If P: John is efficient, T (p) = 0.8
Q: Kim is efficient, T (q) = 0.65 Find
(i)
(ii)
(iii)
(iv)
John is not efficient
John is efficient so is Kim
Either John or Kim is efficient
If John is efficient than so is
Study of Magnetoresistance
AIM: To study the magneto resistance of given semiconductor material.
APPARATUS: Hall probe arrangement, which is a germanium/silicon crystal N or P type with
four spring type pressure contact mounted on sun mica bakelite strip,
Fuzzy Logic and Neural Network
Tutorial -1
Q1.
How is Fuzzy set different from Crisp set? Explain with a graphic example.
Q2.
(a) Describe why there is a need for fuzzy logic after traditional logic.
(b) For each of the following statements, state what ki
Data Link Layer
5: DataLink Layer
5a-1
Link Layer: Introduction
Some terminology:
link
hosts and routers are nodes
(bridges and switches too)
communication channels that
connect adjacent nodes along
communication path are links
wired links
wireless link
List of Electives and Audit Courses
VI Semester Even 2017
Elective courses
1. Advanced Data Structures and Applications
2. Algorithm Design
3. Introduction to Mobile Application Development
4. Agile Software Development
5. Data and Web Mining
6. Computati
Routing Algorithms
4-1
Graph abstraction
5
2
u
2
1
Graph: G = (N,E)
v
x
3
w
3
1
5
1
y
z
2
N = set of routers = cfw_ u, v, w, x, y, z
E = set of links =cfw_ (u,v), (u,x), (v,x), (v,w), (x,w), (x,y), (w,y), (w,z), (y,z)
4-2
Graph abstraction: costs
5
2
u