1. Relational database accesses data in a sequential form. (Figures 7.1, 7.2)



Similar documents
5. A full binary tree with n leaves contains [A] n nodes. [B] log n 2 nodes. [C] 2n 1 nodes. [D] n 2 nodes.

1) The postfix expression for the infix expression A+B*(C+D)/F+D*E is ABCD+*F/DE*++

DATA STRUCTURES USING C

KITES TECHNOLOGY COURSE MODULE (C, C++, DS)

10CS35: Data Structures Using C

Course Description. Spring

A binary search tree or BST is a binary tree that is either empty or in which the data element of each node has a key, and:

Introduction to Computing. Lectured by: Dr. Pham Tran Vu

Lecture 11 Doubly Linked Lists & Array of Linked Lists. Doubly Linked Lists

Copyright 2007 Ramez Elmasri and Shamkant B. Navathe. Slide 13-1

Introduction to Data Structures

Chapter 13 Disk Storage, Basic File Structures, and Hashing.

1. The memory address of the first element of an array is called A. floor address B. foundation addressc. first address D.

INTERNATIONAL JOURNAL OF PURE AND APPLIED RESEARCH IN ENGINEERING AND TECHNOLOGY

MAX = 5 Current = 0 'This will declare an array with 5 elements. Inserting a Value onto the Stack (Push)

Data Structures and Algorithms Written Examination

Algorithms and Data Structures

Chapter 13. Disk Storage, Basic File Structures, and Hashing

Ordered Lists and Binary Trees

Krishna Institute of Engineering & Technology, Ghaziabad Department of Computer Application MCA-213 : DATA STRUCTURES USING C

PART-A Questions. 2. How does an enumerated statement differ from a typedef statement?

TREE BASIC TERMINOLOGIES

Vector storage and access; algorithms in GIS. This is lecture 6

Data Structure with C

BSc (Hons) Business Information Systems, BSc (Hons) Computer Science with Network Security. & BSc. (Hons.) Software Engineering

Picture Maze Generation by Successive Insertion of Path Segment

Files. Files. Files. Files. Files. File Organisation. What s it all about? What s in a file?

Data Structure [Question Bank]

Operating Systems CSE 410, Spring File Management. Stephen Wagner Michigan State University

Physical Data Organization

Analysis of a Search Algorithm

Chapter 13 File and Database Systems

Chapter 13 File and Database Systems

Data Structures. Level 6 C Module Descriptor

Chapter 13. Chapter Outline. Disk Storage, Basic File Structures, and Hashing

Efficient Data Structures for Decision Diagrams

PES Institute of Technology-BSC QUESTION BANK

CSE 211: Data Structures Lecture Notes VII

New Hash Function Construction for Textual and Geometric Data Retrieval

Raster Data Structures

Organization of Programming Languages CS320/520N. Lecture 05. Razvan C. Bunescu School of Electrical Engineering and Computer Science

Section of DBMS Selection & Evaluation Questionnaire

In-Memory Database: Query Optimisation. S S Kausik ( ) Aamod Kore ( ) Mehul Goyal ( ) Nisheeth Lahoti ( )

Oracle8i Spatial: Experiences with Extensible Databases

Quiz 4 Solutions EECS 211: FUNDAMENTALS OF COMPUTER PROGRAMMING II. 1 Q u i z 4 S o l u t i o n s

Stacks. Linear data structures

1 Abstract Data Types Information Hiding

Data Structures and Data Manipulation

Binary Search Trees (BST)

AP Computer Science AB Syllabus 1

ISM 318: Database Systems. Objectives. Database. Dr. Hamid R. Nemati

root node level: internal node edge leaf node Data Structures & Algorithms McQuain

Data Structures and Algorithms

recursion, O(n), linked lists 6/14

Scoping (Readings 7.1,7.4,7.6) Parameter passing methods (7.5) Building symbol tables (7.6)

Structural Design Patterns Used in Data Structures Implementation

WESTMORELAND COUNTY PUBLIC SCHOOLS Integrated Instructional Pacing Guide and Checklist Computer Math

Short Notes on Dynamic Memory Allocation, Pointer and Data Structure

The following themes form the major topics of this chapter: The terms and concepts related to trees (Section 5.2).

Arrays. Atul Prakash Readings: Chapter 10, Downey Sun s Java tutorial on Arrays:

Memory Allocation. Static Allocation. Dynamic Allocation. Memory Management. Dynamic Allocation. Dynamic Storage Allocation

ALLIED PAPER : DISCRETE MATHEMATICS (for B.Sc. Computer Technology & B.Sc. Multimedia and Web Technology)

Lecture 1: Introduction

- Easy to insert & delete in O(1) time - Don t need to estimate total memory needed. - Hard to search in less than O(n) time

æ A collection of interrelated and persistent data èusually referred to as the database èdbèè.

2) What is the structure of an organization? Explain how IT support at different organizational levels.

File System Management

Linked Lists, Stacks, Queues, Deques. It s time for a chainge!

INTRODUCTION The collection of data that makes up a computerized database must be stored physically on some computer storage medium.

Fast Sequential Summation Algorithms Using Augmented Data Structures

Syllabus for Computer Science. Proposed scheme for B.Sc Programme under Choice Based Credit System

Common Data Structures

OKLAHOMA SUBJECT AREA TESTS (OSAT )

Glossary of Object Oriented Terms

Why? A central concept in Computer Science. Algorithms are ubiquitous.

Sources: On the Web: Slides will be available on:

Binary Search Trees CMPSC 122

Data Structures Using C++

Frsq: A Binary Image Coding Method

Thomas Jefferson High School for Science and Technology Program of Studies Foundations of Computer Science. Unit of Study / Textbook Correlation

Chapter 6: Physical Database Design and Performance. Database Development Process. Physical Design Process. Physical Database Design

Chapter 8: Bags and Sets

CS104: Data Structures and Object-Oriented Design (Fall 2013) October 24, 2013: Priority Queues Scribes: CS 104 Teaching Team

Java (12 Weeks) Introduction to Java Programming Language

Atmiya Infotech Pvt. Ltd. Data Structure. By Ajay Raiyani. Yogidham, Kalawad Road, Rajkot. Ph : ,

Triangulation by Ear Clipping

GUJARAT TECHNOLOGICAL UNIVERSITY, AHMEDABAD, GUJARAT. Course Curriculum. DATA STRUCTURES (Code: )

PROBLEM SOLVING SEVENTH EDITION WALTER SAVITCH UNIVERSITY OF CALIFORNIA, SAN DIEGO CONTRIBUTOR KENRICK MOCK UNIVERSITY OF ALASKA, ANCHORAGE PEARSON

Chapter 8: Structures for Files. Truong Quynh Chi Spring- 2013

Chapter 5 Names, Bindings, Type Checking, and Scopes

System Interconnect Architectures. Goals and Analysis. Network Properties and Routing. Terminology - 2. Terminology - 1

Lecture Notes on Binary Search Trees

The C Programming Language course syllabus associate level

Introduction to Object-Oriented Programming

5. Binary objects labeling

Dual Marching Cubes: Primal Contouring of Dual Grids

Record Storage and Primary File Organization

Collision Detection Algorithms for Motion Planning

Data Warehousing und Data Mining

Transcription:

Chapter 7 Data Structures for Computer Graphics (This chapter was written for programmers - option in lecture course) Any computer model of an Object must comprise three different types of entities: 1. Data - basic elements that consist of numerical values, characters, instructions, representation of attributes 2. Algorithm - data manipulation 3. Structure - data organization Structuring of data is a very important aspect of a database, which is a bank of the information to be processed and of the results, stored for future use. General databases The most popular data base models are relational, hierarchical, and network. 1. Relational database accesses data in a sequential form. (Figures 7.1, 7.2) Figure 7.2 Example of a relational database

2. Hierarchical database is a tree structure composed of a hierarchy of elements called nodes. (Figure 7.3) Hierarchical models are usually simple and fast, but only few relations in the real world are purely hierarchical. The other disadvantages of hierarchical structure are the hierarchical implementation usually creates redundancy and a danger of inconsistency (i.e. cannot implement non-manifold models) 3. Network database has a many-to-many relationship among its elements; elements at each level can be connected to many elements of the level above. (Figure 7.4) Basic data structure for graphics 1. Primitive data types - INTEGER, REAL, BOOLEAN (LOGICAL), CHARACTER 2. Static data structure (array) - fixed, predefined values and occupies fixed memory locations. 3. Dynamic data structure (pointer) - dynamic storage allocation

Static arrays (Homogeneous data structure) allow random access, is widely used in computer graphics. DIMENSION A (100) a = array[1..100] of real float a[100]; (FORTRAN) (PASCAL) (C) Static array operations: a. Traversal - accessing and processing each element of the array exactly once. (indexing operation) b. Insertion - adding a new element to an existing list. c. Deletion - removing an element from an existing list. Representation of polyhedral objects using static arrays (Figures 7.6, 7.7, 7.8) The three arrays used in the description of the cube are: 1. A vertex array listing the x, y, z coordinates of each vertex. 2. An edge array, pointing to the vertex array, indicating the two vertices at the end of each edge 3. A face array, pointing to the edge array, listing the edges that form each face Arrays: Face Edge Vertex

Structured data types record struct (PASCAL) (C) Figure 7.9 (a) PASCAL record implementation

Figure 7.9 (b) C struct implementation Pointers struct edge { struct point *pv1, *pv2; } e1.pv1 = &v1; e1.pv2 = &v2; Linked lists In C, a vertex array of variable size n can be dynamically allocated as vertex_header = (struct point*) calloc (n.sizeof(stuct point)); Single linked list has two fields: data and next link. Figure 7.10 Schematic diagram of a linked list

The original list would have to be expanded by the insertion of the new node through three operations: 1. Creation of the new node 2. Linking P2 to the new node 3. Linking the new node to the node P2 was originally point to Figure 7.11 Node insertion in a linked list These unused memory cells would also be linked to form a linked list of available nodes called AVAIL, which uses AVAIL as it list pointer variable. Figure 7.12 Use of an availability list for node insertion In C, the implementation could be struct node { int x, y; struct node *next_link; }; struct node *temp, *nlink; temp = (struct node*) malloc (sizeof(struct node)); temp->x = XNEW;

temp->y = YNEW; temp->next_link = NLINK; NLINK = temp; Double linked list has three fields: data, previous link, and next link. Figure 7.13 Double linked list Figure 7.14 Linked lists describing faces of representation of the structure a polyhedral object Figure 7.15 Schematic of Figure 7.14

Figure 7.16 A more general hierarchical linked data structure for polyhedral geometry Recursion E. g. Quadtree and octree data structures use of recursive methods in computer graphics applications.

Figure 7.17 Recursive subdivision of a two-dimensional region Trees Binary Tree - Each node of the tree has at most two children. Usually, binary tree is used in CSG (Constructive Solid Geometry) representation. The nodes in a binary tree are usually created by linked lists with pointers to its two children. Figure 7.18 A general tree structure Figure 7.19 Three structure for a quadtree

Geometry representations: 1. CSG (Constructive Solid Geometry) 2. B-Rep (Boundary Representation)