Data Structures: Introduction
CSC212
1
Data Types & Data Structures
Applications/programs read data, store data temporarily, process it and finally output results. What is data? Numbers, Characters,
Heaps & Priority Queues
A heap is a binary tree. A heap is best implemented in sequential representation (using an array). Two important uses of heaps are:
(i) efficient implementation of priority q
B-Trees
1
B-trees: Why?
Best tree discussed so far AVL Tree: Important operation Findkey() can be implemented in O(log n) time. AVL Tree has problems for large data
the size of the AVL tree increase
AVL Trees
1
AVL Trees
Consider a situation when data elements are inserted in a BST in sorted order: 1, 2, 3, . 1 BST becomes a 2 degenerate tree. Search operation 3 FindKey takes O(n), n which is as
Binary Search Trees (BSTs)
1
Binary Search Trees (BSTs)
Consider the search operation FindKey (): find an element of a particular key value in a binary tree. This operation takes O(n) time in a binar
General Trees & Binary Trees
CSC212
1
Trees
Previous data structures (e.g. lists, stacks, queues) have a linear structure. Linear structures represent one-to-one relation between data elements. Trees
Stacks, Queues & Deques
CSC212
1
Stacks & Queues
Stack: Last In First Out (LIFO).
Used in procedure calls, to compute arithmetic expressions etc.
Queue: First In First Out (FIFO).
Used in operatin
Data Structures
ADT List
1
ADT List
Elements Structure
Domain User of an ADT must only know this
Operations
Specification Representation Implementation
2
Implementer must know all these.
ADT List: Spe
Data Structures
CSC212
1
Fundamental Concepts
Some fundamental concepts that you should know:
Dynamic memory allocation. Recursion. Performance analysis.
2
Performance Analysis
There are problems an
Hashing Techniques
1
Hashing Techniques
Several ADTs for storing and retrieving data were discussed Linear Lists, Binary Trees, BSTs, AVL Trees. An important operation Findkey() has a time complexity