Lecture%2014%20-%20%20Generic%20Data%20structures

Lecture%2014%20-%20%20Generic%20Data%20structures - Lecture...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
Copyright @ 2009 Ananda Gunawardena Lecture 14 Generic Data Structures In this lecture Introduction to Generic Data structures Examples An Introduction to Generic Data Structures Programs use many different data structures such as arrays, linked lists, hash tables, general trees, binary search trees, heaps etc. Each data structure is a container that holds a particular data type. Operations changes from data type to data type, for example, how you add two integers is not the same as how you “add” two tables. While we understand how to add two integers, “adding” two tables can be custom defined. Generic data types are important in designing libraries that works with “any” data type. A dynamic binding between data type and data structure occurs at run time. Generic data types are common in some high level languages. For example in Java 5, a generic data type can be defined using: /** * Generic version of the Item class. */ public class Item
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 11/27/2009 for the course CS 123 taught by Professor Bajkzek during the Fall '08 term at Carnegie Mellon.

Page1 / 3

Lecture%2014%20-%20%20Generic%20Data%20structures - Lecture...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online