Chapter - 2 Data strucuters for Language processing.

Slides:



Advertisements
Similar presentations
Disk Storage, Basic File Structures, and Hashing
Advertisements

Memory.
Symbol Table.
CSE 1302 Lecture 23 Hashing and Hash Tables Richard Gesick.
Lecture 10: Heap Management CS 540 GMU Spring 2009.
The Assembly Language Level
Data Structures Using C++ 2E
Hashing as a Dictionary Implementation
File Processing - Indirect Address Translation MVNC1 Hashing Indirect Address Translation Chapter 11.
Chapter 10: File-System Interface
Searching Kruse and Ryba Ch and 9.6. Problem: Search We are given a list of records. Each record has an associated key. Give efficient algorithm.
Chapter 8 Runtime Support. How program structures are implemented in a computer memory? The evolution of programming language design has led to the creation.
Memory Management. History Run-time management of dynamic memory is a necessary activity for modern programming languages Lisp of the 1960’s was one of.
1 Foundations of Software Design Fall 2002 Marti Hearst Lecture 18: Hash Tables.
Memory Allocation. Three kinds of memory Fixed memory Stack memory Heap memory.
METU Department of Computer Eng Ceng 302 Introduction to DBMS Disk Storage, Basic File Structures, and Hashing by Pinar Senkul resources: mostly froom.
Run time vs. Compile time
The environment of the computation Declarations introduce names that denote entities. At execution-time, entities are bound to values or to locations:
Copyright © 2007 Ramez Elmasri and Shamkant B. Navathe Chapter 13 Disk Storage, Basic File Structures, and Hashing.
Data Structures Using C++ 2E Chapter 9 Searching and Hashing Algorithms.
File Concept §Contiguous logical address space §Types: l Data: Numeric Character Binary l Program.
C o n f i d e n t i a l Developed By Nitendra NextHome Subject Name: Data Structure Using C Title: Overview of Data Structure.
CHAPTER 71 TREE. Binary Tree A binary tree T is a finite set of one or more nodes such that: (a) T is empty or (b) There is a specially designated node.
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 17 Disk Storage, Basic File Structures, and Hashing.
Symbol Tables Symbol tables are used by compilers to keep track of information about variables functions class names type names temporary variables etc.
Computer Security and Penetration Testing
Final Review Dr. Bernard Chen Ph.D. University of Central Arkansas Spring 2010.
Compiler Construction
Chapter 14 Dynamic Data Structures Instructor: Kun-Mao Chao ( 台大資工 趙坤茂 )
1 Hash table. 2 A basic problem We have to store some records and perform the following:  add new record  delete record  search a record by key Find.
1 Symbol Tables The symbol table contains information about –variables –functions –class names –type names –temporary variables –etc.
One Pass with Fixup One-pass structure definition must occur before any uses (that is, uses can have only backward references to definitions) examples:
Comp 335 File Structures Hashing.
Paging Example What is the data corresponding to the logical address below:
Lists II. List ADT When using an array-based implementation of the List ADT we encounter two problems; 1. Overflow 2. Wasted Space These limitations are.
1 5. Abstract Data Structures & Algorithms 5.2 Static Data Structures.
Module 4.0: File Systems File is a contiguous logical address space.
BİL 744 Derleyici Gerçekleştirimi (Compiler Design)1 Run-Time Environments How do we allocate the space for the generated target code and the data object.
File Structures. 2 Chapter - Objectives Disk Storage Devices Files of Records Operations on Files Unordered Files Ordered Files Hashed Files Dynamic and.
Been-Chian Chien, Wei-Pang Yang, and Wen-Yang Lin 8-1 Chapter 8 Hashing Introduction to Data Structure CHAPTER 8 HASHING 8.1 Symbol Table Abstract Data.
CS535 Programming Languages Chapter - 10 Functional Programming With Lists.
CS 153: Concepts of Compiler Design October 7 Class Meeting Department of Computer Science San Jose State University Fall 2015 Instructor: Ron Mak
Lecture by: Prof. Pooja Vaishnav.  Language Processor implementations are highly influenced by the kind of storage structure used for program variables.
1 CSCD 326 Data Structures I Hashing. 2 Hashing Background Goal: provide a constant time complexity method of searching for stored data The best traditional.
Hashing COMP171. Hashing 2 Hashing … * Again, a (dynamic) set of elements in which we do ‘search’, ‘insert’, and ‘delete’ n Linear ones: lists, stacks,
Lec 5 part2 Disk Storage, Basic File Structures, and Hashing.
Circular linked list A circular linked list is a linear linked list accept that last element points to the first element.
1 Principles revisited.NET: Two libraries: System.Collections System.Collections.Generics Data Structures and Collections.
Chapter 5 Record Storage and Primary File Organizations
CHAPTER 51 LINKED LISTS. Introduction link list is a linear array collection of data elements called nodes, where the linear order is given by means of.
1 Compiler Construction Run-time Environments,. 2 Run-Time Environments (Chapter 7) Continued: Access to No-local Names.
Memory Management CSCI 2720 Spring What is memory management? “the prudent utilization of this scarce resource (memory), whether by conservation,
Top 50 Data Structures Interview Questions
Data Structure Interview Question and Answers
Hashing CSE 2011 Winter July 2018.
Dynamic Memory Allocation
Compilers.
Data Structures Interview / VIVA Questions and Answers
Oracle SQL*Loader
Concepts of programming languages
Cse 373 April 26th – Exam Review.
Disk Storage, Basic File Structures, and Hashing
Chapter 10 Hashing.
Directory Structure A collection of nodes containing information about all files Directory Files F 1 F 2 F 3 F 4 F n Both the directory structure and the.
Lecture 3: Main Memory.
Chapter 10: File-System Interface
Introduction to Data Structures
Symbol Table 薛智文 (textbook ch#2.7 and 6.5) 薛智文 96 Spring.
C H A P T E R F I V E Memory Management.
Run-time environments
Presentation transcript:

Chapter - 2 Data strucuters for Language processing

Classification 1. Based on nature ---- Linear and Non-linear eg :- Linear = array, stack etc. Non-Linear = Tree, Graph etc. 2. Based on Purpose --- Search or allocation eg :- Search = Binary search tree allocation = stacks,heaps 3.Based on Lifetime ---- whether used during Language Processing or during target program executions eg :- Lang. Processing = Object based data model Target program = Hash tables

Search Data Structures

Entry Format

Fixed and Variable Length entries

Generic Search Procedure

Binary Search Organization All entries in table satisfies the order relation They keep entries according to order Uses symbols like ‘ ’ It uses algorithm to make entries represened in next slide

Hash Tables

H is the Hasing function. S is the symmbols for entry S(e) is current entry symbol

Hashing Function Hashing function is used to make search system faster. It transforms the source symbol or group of symbols to numerical numbers to make faster comparisons and searching Hashing do not change the original meaning of symbols it just transforms them to other form. Size is pre decided for transforming message to particular format If message is of less size than that size, it performs “folding” operation In folding message is padded with 0’s to complete the size of it.

Properties of good hashing func.

examples of hash function 1. Multiplication of numbers h(s) will result some number by multiplying symbols with predefined number to generate various hash values 2. Division function, it will also divide the symbol by some pre defined number and convert the symbol to numeric value. 3.Exponential method, like all mathematical funciton this can also be used

Collision in hashing Many function result into same number generation which leads to collision of numbers and searching will crash Thus to avoid collision we have varsious collision handling techniques 1. Rehasing technique 2. Overflow chaining technique

Rehasing

Overflow chaining It avoids collision by creating new table for colliding entry in overflow table Every entry contains a pointer for mapping with pointer poiting towards other entry in overflow table Symbols associated with tables are chained together thus this technique is called chaining technique.

Linked List

Binary Tree Each entry in tree is having two fields 1.left_pointer and 2. right_pointer If s is symbol on left of tree then all the entries on left will be less then root node And if s is on right then every S will be greater then root node/entry

Nested Search

Stacks

Extended Stack model

Heaps

Memory managment Due to repetition of allocation and deallocation of memory area holes are created in memory area. Memory management takes care of this holes and reallocate this area by managing it properly It increases performance and speed of allocation and deallocation of memory spaces

Identifying free memory area Two popular techniques are :- 1. Reference counts 2.Garbage Colletion

Reference count It associates a reference count number with memory area to indicate number of active users Number increases when user access memory and decreases when user releases memory area Area is said to be free when number drops to zero

Garbage collection It makes two passes over memory to get unused areas In first pass it traverse through all memory and marks every memory in use. In second pass all unmarked areas are declared as free memory areas. They are called every time system runs out of memory to allocate new memory area.