Thanks to visit codestin.com
Credit goes to www.scribd.com

0% found this document useful (0 votes)
106 views2 pages

Data Structures for CS Students

The document discusses the tree data structure and its common traversal methods like inorder, preorder and postorder. It also discusses the time complexity of operations like search, insertion, deletion on binary trees which is O(n) in general. Binary heaps allow performing insert and delete-min in O(logn) time, making them efficient for priority queue applications.

Uploaded by

Parth Mistry
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
106 views2 pages

Data Structures for CS Students

The document discusses the tree data structure and its common traversal methods like inorder, preorder and postorder. It also discusses the time complexity of operations like search, insertion, deletion on binary trees which is O(n) in general. Binary heaps allow performing insert and delete-min in O(logn) time, making them efficient for priority queue applications.

Uploaded by

Parth Mistry
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

Tree ADT

Inorder : LPR : Preorder : DIR ; Postorder


: (RD

is time
complexity for bay the 0 (n)
postolder deletion
- holder , preorder , ,
search ,
insertion ,
=

0 (n)
get floorently ceiligently put
I
methods ,
remove =

, , ,

the
height his o(n) in worst case &
ofligh in best .
case

&
3 AUL the
performance .

0(1) time
-
sing restructure
=


get put remove
, ,
takes O
(logn) time
As leap :
heaphight = 0
(logn)
A
complete bildly
man
tre

heap on min heak unheap lins in o(logn)


I
downheap = 0
Clogn&
Node at
position i insert
,
Remove Min =

(logn)
C

(i) time
left child-Lite
eilge is
Empty mil O .
=

, ,

right child 2 :+2


:

parent at indus : (i-D heap has ed pliolity quene


=

E
sort in 0
(n log n) Ame
Heap sort is must faster then gradati
porting algorith such insection solt as -

& selection solt .

You might also like