60 Pages

slide20

Course: CS 3410, Fall 2009
School: Bowling Green
Rating:
 
 
 
 
 

Word Count: 3137

Document Preview

Tables Saurav Hash Karmakar 1 Motivation What are the dictionary operations? (1) Insert (2) Delete (3) Search (most of the time, we will be focusing on search) 2 Objective Searching takes (n) time in the worst case (when the data is unorganized). Even using binary search it takes (log n) time when the data are sorted. Our Objective? O(1) time on average using hashing, under a reasonable assumption. 3...

Register Now

Unformatted Document Excerpt

Coursehero >> Ohio >> Bowling Green >> CS 3410

Course Hero has millions of student submitted documents similar to the one
below including study guides, practice problems, reference materials, practice exams, textbook help and tutor support.

Course Hero has millions of student submitted documents similar to the one below including study guides, practice problems, reference materials, practice exams, textbook help and tutor support.
Tables Saurav Hash Karmakar 1 Motivation What are the dictionary operations? (1) Insert (2) Delete (3) Search (most of the time, we will be focusing on search) 2 Objective Searching takes (n) time in the worst case (when the data is unorganized). Even using binary search it takes (log n) time when the data are sorted. Our Objective? O(1) time on average using hashing, under a reasonable assumption. 3 Definitions A hash table is a generalization of an array (direct addressing is allowed), so let's first talk about direct-address table. Universe of keys U={0,1,2,...,m-1}, no two elements have the same key. To represent a dynamic set, we use an array, or direct address table T[0..m-1], in which each position (slot) corresponds to the key in the universe. 4 Definitions To represent a dynamic set, we use an array, or direct address table T[0..m-1], in which each position (slot) corresponds to a key in the T universe. 0 1 U (universe of keys) 1 9 K (actual keys) 2 3 8 5 0 4 2 3 4 5 6 7 8 9 / / / 8 5 / / satellite key data 2 3 / 5 With a direct address table T[0..m-1], how do we search an element x with key k? Direct-Address-Search(T,k): return T[k] T 0 1 U (universe of keys) 1 9 K (actual keys) 2 3 8 5 0 4 2 3 4 5 6 7 8 9 / / / 8 6 / / satellite key data 2 3 / 5 With a direct address table T[0..m-1], how do we search/ insert/delete an element x with key k? Direct-Address-Search(T,k): return T[k] Direct-Address-Insert(T,x): T[key[x]] x Direct-Address-Delete(T,x): T[key[x]] Nil T 0 1 U (universe of keys) 1 9 K (actual keys) 2 3 8 5 0 4 2 3 4 5 6 7 8 9 / / / 8 7 / / satellite key data 2 3 / 5 With a direct address table T[0..m-1], how do we search/ insert/delete an element x with key k? Direct-Address-Search(T,k): return T[k] Direct-Address-Insert(T,x): T[key[x]] x O(1) T satellite key data 2 3 / 5 / / 8 / 8 time! Direct-Address-Delete(T,x): T[key[x]] Nil 0 1 U (universe of keys) 1 9 K (actual keys) 2 3 8 5 0 4 2 3 4 5 6 7 8 9 / / With a direct address table T[0..m-1], how do we search/ insert/delete an element x with key k? Direct-Address-Search(T,k): return T[k] Direct-Address-Insert(T,x): T[key[x]] x Problem? Direct-Address-Delete(T,x): T[key[x]] Nil 0 1 U (universe of keys) 1 9 K (actual keys) 2 3 8 5 0 4 2 3 4 5 6 7 8 9 / / / 8 9 T satellite key data 2 3 / / / 5 Hash Table With direct addressing, an element with key k is inserted in slot h(k). h is called a hash function. h maps the universe U of keys into the slots of a hash table T[0..m-1]. T h : U {0,1,...,m-1} 0 1 U (universe of keys) 1 9 K (actual keys) 2 3 8 5 0 4 2 3 4 5 6 7 8 9 / 8 / / 2 3 / 5 / / 10 Basic Idea Use hash function to map keys into positions in a hash table Ideally If element e has key k and h is hash function, then e is stored in position h(k) of table To search for e, compute h(k) to locate position. If no element, dictionary does not contain e. 11 Hash Table: Collision Problem With direct addressing, an element with key k is inserted in slot h(k). h is called a hash function. h maps the universe U of keys into the slots of a hash table T[0..m-1]. T h : U {0,1,...,m-1} 0 1 U (universe of keys) 1 9 K (actual keys) 2 3 8 5 0 4 2 3 4 5 6 7 8 9 / / / / 2 3 / 5 8 / / If h(5)=h(8) X Collision! 12 Collision Two keys hash to the same slot --- collision. While collision is hard to avoid, if we design the hash function carefully we can at least decrease the chance for collision (and in some cases may avoid T collision). 0 1 U (universe of keys) 1 9 K (actual keys) 2 3 8 5 0 4 2 3 4 5 6 7 8 9 / / / / 2 3 / 5 8 / / If h(5)=h(8) X Collision! 13 Collision Resolution by Chaining Two keys hash to the same slot --- collision. While collision is hard to avoid, if we design the hash function carefully we can at least decrease the chance for collision (and in some cases may avoid T collision). 0 1 U (universe of keys) 1 9 K (actual keys) 2 3 8 5 0 4 2 3 4 5 6 7 8 9 / / 14 / / / / 2 3 / 5 8 If h(5)=h(8) Collision Resolution by Chaining Chained-Hash-Insert(T,x): insert x at the head of list T[h(key[x])] Chained-Hash-Search(T,k): search for an element with key k in list T[h(k)] T 0 1 U (universe of keys) 1 9 K (actual keys) 2 3 8 5 0 4 2 3 4 5 6 7 8 9 / / 15 / / / / 2 3 / 5 8 If h(5)=h(8) Collision Resolution by Chaining Chained-Hash-Insert(T,x): insert x at the head of list T[h(key[x])] Chained-Hash-Search(T,k): search for an element with key k in list T[h(k)] Chained-Hash-Delete(T,x): delete x from the list T[h(key[x])] Time? U (universe of keys) 1 9 K (actual keys) 2 3 8 5 0 4 T 0 1 2 3 4 5 6 7 8 9 / / 16 / / / / 2 3 / 5 8 If h(5)=h(8) Collision Resolution by Chaining Example: Let h(k)= k mod 11, insert 5,28,19,15,20,33,12,17,39,11 into T[0..10]. T 0 1 2 3 4 5 6 7 8 9 10 / / 19 20 17 11 12 / / 15 5 39 33 17 28 Hash function A hash function which causes no collision is called perfect hash function. A good hash function is one which satisfies simple uniform hashing --- each key is equally likely to hash to any of the m slots. (It is difficult to check this condition though.) Now let's see some example for hash functions. Assume that all the keys can be represented as natural numbers. 18 Famous Examples of Hash Functions Division: h(k) = k mod m, m should be a prime number, better close to a power of 2. Multiplication: h(k) = floor [m(kA mod 1)], A=(5 1)/2=0.61803... Two step process Step 1: Multiply the key k by a constant 0< A < 1 and extract the fraction part of kA. Step 2: Multiply kA by m and take the floor of the result. 19 Famous Examples of Hash Functions Division: h(k) = k mod m, m should be a prime number, better close to a power of 2. Multiplication: h(k) = m(kA mod 1), A=(5 1)/2=0.61803... Example. K = 123456, m=10000. h(k) = 10000(123456 x 0.61803... mod 1) 20 Famous Examples of Hash Functions Division: h(k) = k mod m, m should be a prime number, better close to a power of 2. Multiplication: h(k) = m(kA mod 1), A=(5 1)/2=0.61803... Example. K = 123456, m=10000. h(k) = 10000(123456 x 0.61803... mod 1) = 10000(76300.0041151... mod 1) 21 Famous Examples of Hash Functions Division: h(k) = k mod m, m should be a prime number, better close to a power of 2. Multiplication: h(k) = m(kA mod 1), A=(5 1)/2=0.61803... Example. K = 123456, m=10000. h(k) = 10000(123456 x 0.61803... mod 1) = 10000(76300.0041151... mod 1) = 10000 x 0.0041151...) 22 Division: h(k) = k mod m, m should be a prime number, better close to a power of 2. Multiplication: h(k) = m(kA mod 1), A=(5 1)/2=0.61803. Example. K = 123456, m=10000. h(k) = 10000(123456 x 0.61803 mod 1) = 10000(76300.0041151... mod 1) = 10000 x 0.0041151...) = 41.151... Famous Examples of Hash Functions 23 Division: h(k) = k mod m, m should be a prime number, better close to a power of 2. Multiplication: h(k) = m(kA mod 1), A=(5 1)/2=0.61803. Example. K = 123456, m=10000. h(k) = 10000(123456 x 0.61803 mod 1) = 10000(76300.0041151... mod 1) = 10000 x 0.0041151...) = 41.151... = 41 Famous Examples of Hash Functions 24 Division: h(k) = k mod m, m should be a prime number, better close to a power of 2. Multiplication: h(k) = m(kA mod 1), A=(5 1)/2=0.61803. Folding: The key is divided into several parts. These parts are combined or folded together and are transformed in a certain way to create the target address. Example 1. Shift folding: 123-456-789 (SSN) 123+456+789 = 1368 1368 mod 1000 = 368. Famous Examples of Hash Functions 25 Division: h(k) = k mod m, m should be a prime number, better close to a power of 2. Multiplication: h(k) = m(kA mod 1), A=(5 1)/2=0.61803. Folding: The key is divided into several parts. These parts are combined or folded together and are transformed in a certain way to create the target address. Example 1. Shift folding: 123-456-789 (SSN) 123+456+789 = 1368 1368 mod 1000 = 368. Example 2. Boundary folding: 123-456-789 (SSN) 123+654+789 = 1566 1566 mod 1000 = 566. Famous Examples of Hash Functions 26 Division: h(k) = k mod m, m should be a prime number, better close to a power of 2. Multiplication: h(k) = m(kA mod 1), A=(5 1)/2=0.61803. Folding: The key is divided into several parts. These parts are combined or folded together and are transformed in a certain way to create the target address. Mid-square function: key is squared and the middle part of the result is taken as the address. Example. k=3121, 31212 = 9740641, so h(k) = Famous Examples of Hash Functions 27 Division: h(k) = k mod m, m should be a prime number, better close to a power of 2. Multiplication: h(k) = m(kA mod 1), A=(5 1)/2=0.61803. Folding: The key is divided into several parts. These parts are combined or folded together and are transformed in a certain way to create the target address. Mid-square function: key is squared and the middle part of the result is taken as the address. Example. k=3121, 31212 = 9740641, so h(k) = 406. You can also encode the square into binary representation and take the middle part. Famous Examples of Hash Functions 28 Division: h(k) = k mod m, m should be a prime number, better close to a power of 2. Multiplication: h(k) = m(kA mod 1), A=(5 1)/2=0.61803. Folding: The key is divided into several parts. These parts are combined or folded together and are transformed in a certain way to create the target address. Mid-square function: key is squared and the middle part of the result is taken as the address. Extraction: Only a part of the key is used to compute the address. Example: 123456789, first 4 digits 1234, last 4 digits 6789 first 2 digits of 1234 last 2 digits of 6789 we have 1289 Famous Examples of Hash Functions 29 Division: h(k) = k mod m, m should be a prime number, better close to a power of 2. Multiplication: h(k) = m(kA mod 1), A=(5 1)/2=0.61803. Folding: The key is divided into several parts. These parts are combined or folded together and are transformed in a certain way to create the target address. Mid-square function: key is squared and the middle part of the result is taken as the address. Extraction: Only a part of the key is used to compute the address. Radix Transformation: is k transformed into another number base Example: 34510 = 4239 , then 423 mod 100 = 23. Famous Examples of Hash Functions 30 Division: h(k) = k mod m, m should be a prime number, better close to a power of 2. Multiplication: h(k) = m(kA mod 1), A=(5 1)/2=0.61803. Folding: The key is divided into several parts. These parts are combined or folded together and are transformed in a certain way to create the target address. Mid-square function: key is squared and the middle part of the result is taken as the address. Extraction: Only a part of the key is used to compute the address. Radix Transformation: k is transformed into another number base Example: 34510 = 4239 , then 423 mod 100 = 23. 26410 = 3239, then 323 mod 100 =23. Famous Examples of Hash Functions 31 Division: h(k) = k mod m, m should be a prime number, better close to a power of 2. Multiplication: h(k) = m(kA mod 1), A=(5 1)/2=0.61803. Folding: The key is divided into several parts. These parts are combined or folded together and are transformed in a certain way to create the target address. Mid-square function: key is squared and the middle part of the result is taken as the address. Extraction: Only a part of the key is used to compute the address. Radix Transformation: k is transformed into another number base Example: 34510 = 4239 , then 423 mod 100 = 23. 26410 = 3239, then 323 mod 100 =23. Collision is hard to avoid in the worst case! 32 Famous Examples of Hash Functions Division: h(k) = k mod m, m should be a prime number, better close to a power of 2. Multiplication: h(k) = m(kA mod 1), A=(5 1)/2=0.61803. Folding: The key is divided into several parts. These parts are combined or folded together and are transformed in a certain way to create the target address. Mid-square function: key is squared and the middle part of the result is taken as the address. Extraction: Only a part of the key is used to compute the address. Radix Transformation: k is transformed into another number base Famous Examples of Hash Functions 33 Open Addressing In some applications, it is hard to dynamically allocate additional space for handling the chaining. So it is natural to come up with a different way to handle collision in which all elements are stored in the hash table itself. Then, instead of following pointers, we simply compute the sequences of slots to be examined. Let's use insertion as an example. 34 Open Addressing Let's use insertion as an example. To perform insertion using open addressing, we successively examine or probe the hash table until we find an empty slot to put the element. Moreover, the sequence of positions probed depends on the key being inserted; i.e., h: U x {0,1,...,m-1} {0,1,...,m-1} 35 Open Addressing To perform insertion using open addressing, we successively examine or probe the hash table until we find an empty slot to put the element. Moreover, the sequence of positions probed depends on the key being inserted; i.e., h: U x {0,1,...,m-1} {0,1,...,m-1} Apparently, for every key k, the probe sequence <h(k,0), h(k,1),...,h(k,m-1)> is a permutation of <0,1,...,m-1> so that every position in the hash table is eventually considered as a slot for a new key as the table fills up. Now, for simplicity, assume k=x, and there is no deletion. 36 Open Addressing Hash-Insert(T,k) 1. i 0 2. repeat j h(k,i) 1. if T[j] == Nil 2. then T[j] k 3. return j 4. else i i + 1 7. until i=m 8. error "hash table overflow" 37 Open Addressing Hash-Insert(T,k) 1. i 0 2. repeat j h(k,i) 1. if T[j] == Nil 2. then T[j] k 3. return j 4. else i i + 1 7. until i=m 8. error "hash table overflow" T 0 1 2 3 4 5 6 7 Example. Insert keys 10,22,31,4,15,28,17,88,59 into T. h(k,i)=[h'(k)+i] mod m, 8 9 10 38 Open Addressing Hash-Insert(T,k) 1. i 0 2. repeat j h(k,i) 1. if T[j] == Nil 2. then T[j] k 3. return j 4. else i i + 1 7. until i=m 8. error "hash table overflow" T 0 1 2 3 4 5 6 7 Example. Insert keys 10,22,31,4,15,28,17,88,59 into T. h(k,i)=[h'(k)+i] mod m, 8 9 10 10 39 h(10,0)=(10+0) mod 11 = 10 Open Addressing Hash-Insert(T,k) 1. i 0 2. repeat j h(k,i) 1. if T[j] == Nil 2. then T[j] k 3. return j 4. else i i + 1 7. until i=m 8. error "hash table overflow" T 0 1 2 3 4 5 6 7 Example. Insert keys 10,22,31,4,15,28,17,88,59 into T. h(k,i)=[h'(k)+i] mod m, 8 9 10 31 10 40 22 h(10,0)=(10+0) mod 11 = 10 h(22,0)= 0 4 h(31,0)=9 h(4,0)=4 h(15,0)=(4+0) mod 11 =4 Open Addressing Hash-Insert(T,k) 1. i 0 2. repeat j h(k,i) 1. if T[j] == Nil 2. then T[j] k 3. return j 4. else i i + 1 7. until i=m 8. error "hash table overflow" T 0 1 2 3 4 5 6 7 Example. Insert keys 10,22,31,4,15,28,17,88,59 into T. h(k,i)=[h'(k)+i] mod m, 8 9 10 31 10 4 15 22 h(10,0)=(10+0) mod 11 = 10 h(22,0)= 0 h(31,0)=9 h(4,0)=4 h(15,0)=(4+0) mod 11 =4 h(15,1)=(4+1) mod 11 =5 41 Open Addressing Hash-Insert(T,k) 1. i 0 2. repeat j h(k,i) 1. if T[j] == Nil 2. then T[j] k 3. return j 4. else i i + 1 7. until i=m 8. error "hash table overflow" T 0 1 2 3 4 5 6 7 Example. Insert keys 10,22,31,4,15,28,17,88,59 into T. h(k,i)=[h'(k)+i] mod m, 8 9 10 4 15 28 17 59 31 10 42 22 88 Open Addressing Hash-Search(T,k) 1. i 0 2. repeat j h(k,i) 1. if T[j] == k 2. then return j 3. i i + 1 6. until T[j]=Nil or i=m 7. return Nil T 0 1 2 3 4 5 6 7 Example. Search 15 in T. h(k,i)=[h'(k)+i] mod m, h'(k)=k mod m. 8 9 10 4 15 28 17 59 31 10 43 22 88 i=0 j h(15,0)=4 T[j] != 15 i=1 j h(15,1)=5 T[j] = 15 return 5 Open Addressing How about deletion? You can simply use Hash-Search to find the key first. Then what? 0 1 T 22 88 1. i 0 2. repeat j h(k,i) 1. if T[j] != Nil and T[j]==k 2. then T[j] Nil? exit 3. i i + 1 6. until T[j]=Nil or i=m 2 3 4 5 6 7 8 4 15 28 17 59 31 10 44 Example. Delete 4,15 in T. h(k,i)=[h'(k)+i] mod m, h'(k)=k mod m. 9 10 Open Addressing How about deletion? You can simply use Hash-Search to find the key first. Then what? 0 1 T 22 88 1. i 0 2. repeat j h(k,i) 1. if T[j] != Nil and T[j] == k 2. then T[j] Nil?, exit 3. ...

Find millions of documents on Course Hero - Study Guides, Lecture Notes, Reference Materials, Practice Exams and more. Course Hero has millions of course specific materials providing students with the best way to expand their education.

Below is a small sample set of documents:

Bowling Green - CS - 3410
Dynamic Programming8 1Fibonacci sequenceFibonacci sequence: 0 , 1 , 1 , 2 , 3 , 5 , 8 , 13 , 21 , . Fi = i if i 1 Fi = Fi1 + Fi2 if i 2 Solved by a recursive program: f4f5f3f3f2f2f1f2f1f1f0f1f
Bowling Green - CS - 1010
Chapter 3 Application Softw ar eChapter 3 ObjectivesIdentify the categories of application software Explain ways software is distributed Explain how to work with application software Identify the key features of widely used business programs Ident
Bowling Green - CS - 1010
Chapter 4 The Components of the System UnitChapter 4 ObjectivesDifferentiate among various styles of system units Identify chips, adapter cards, and other components of a motherboard Describe the components of a processor and how they complete a m
Bowling Green - CS - 1010
Chapter 7 StorageChapter 7 ObjectivesDifferentiate between storage devices and storage media Describe the characteristics of magnetic disks Differentiate between floppy disks and Zip disks Describe the characteristics of a hard disk Describe the c
Bowling Green - CS - 1010
Bowling Green - CS - 1010
Comprehensive Concepts and Techniques Third EditionHTML2nd ProjectCreating and Editing a Web PageProject Objectives Identify elements of a Web page Start Notepad and describe the Notepad window Enable word wrap in Notepad Enter the HTML ta
Bowling Green - CS - 1010
Bowling Green - CS - 2311
Chapter 1Introduction to Computers and C+ ProgrammingCopyright 2007 Pearson Education, Inc. Publishing as Pearson Addison-WesleyOverview1.1 Computer Systems 1.2 Programming and Problem Solving 1.3 Introduction to C+ 1.4 Testing and Debugging
Bowling Green - CS - 2311
Chapter 2C+ BasicsCopyright 2007 Pearson Education, Inc. Publishing as Pearson Addison-WesleyOverview2.1 Variables and Assignments 2.2 Input and Output 2.3 Data Types and Expressions 2.4 Simple Flow of Control 2.5 Program StyleCopyright 2007
Bowling Green - CS - 2311
Chapter 3More Flow of ControlCopyright 2007 Pearson Education, Inc. Publishing as Pearson Addison-WesleyOverview3.1 Using Boolean Expressions 3.2 Multiway Branches 3.3 More about C+ Loop Statements 3.4 Designing LoopsCopyright 2007 Pearson
Bowling Green - CS - 2311
Chapter 4Procedural Abstraction and Functions That Return a ValueOverview4.1 Top-Down Design 4.2 Predefined Functions 4.3 Programmer-Defined Functions 4.4 Procedural Abstraction 4.5 Local Variables 4.6 Overloading Function Names4.1Top-Down D
Bowling Green - CS - 2311
Chapter 7ArraysOverview7.1 Introduction to Arrays 7.2 Arrays in Functions 7.3 Programming with Arrays 7.4 Multidimensional Arrays7.1Introduction to ArraysIntroduction to ArrayssAn array is used to process a collection of data of the sam
Virginia Tech - CS - 2604
GIS Indexer II by Bill McQuainGIS file: Highland.txtScript file: Script08.txtTime: Sun Nov 27 13:51:15 2005-Beginning construction of initial indices.Begin parsing of GIS record file Added 289 GIS records to location index Add
Virginia Tech - CS - 2604
Programmer: Bill McQuainProtein dB Project dB file: MediumDB.bin script file: Script04.txt log file: Log04.txt-Command 1: show_accessionO27748Find: going left from (P38502, (18322, 494)Find: going left from (P15038, (359
Bowling Green - CSC - 6370
Chapter 4Basics of JavaScriptCopyright 2008 Pearson Education, Inc. Publishing as Pearson Addison-WesleyJavaScript/EcmaScript References The official EcmaScript, third edition, specification http:/www.ecma-international.org/publications/files
Bowling Green - MATH - 1070
Chapter 19 Comparing Two ProportionsOutline Twosample problems: proportions The sampling distribution of a difference between proportions Largesample confidence intervals for comparing proportions Significance tests for comparing proportions
Bowling Green - CS - 3320
Practice 11) Create a sub-directory called &lt;temp&gt; in your home directory which is the working directory when you just log in. cd mkdir temp2) Create a sub-directory called &lt;subtemp&gt; in &lt;temp&gt; mkdir ./temp/subtemp3) Create file ex
Bowling Green - CS - 3320
Practice 2: (VI)1. Open Try.java by vi2. Find ConfigFile by moving cursor3. Append XXX to ConfigFile4. Append multiple lines after the line including ConfigFile5. Delete XXX6. Copy the first 10 lines7. Delete the first 10 lines8. Save it9. e
Bowling Green - CS - 3320
1. True or false(draw circle in your choice):a) Two people on the same UNIX computer can have the same password.Tb) Two people on the same UNIX computer can have the same login name.Fc) Any user can use the passwd command to change someone elses
Bowling Green - CS - 3320
Student Name ID Reg Status Program Credits Adeyemi, Joseph T. 0011415432 *Web Registered* BS COMPUTER SCIENCE 3.004 Avery, Akeem J. 0011594651 *Web Registered* BS COMPUTER SCIENCE 3.000 Ball, Courtney E. 0011805451 *Web R
Bowling Green - CS - 3320
Homework 2 Due: 11:00am Feb 12 Email to gsucst@gmail.com Note: write your answers under each question. Please don't send me the log file or copy of your executing results in qubit. Download file rolllist.txt, search and sort of this
Bowling Green - CS - 3320
Practice 4 1. Display the name of the owner of the shell whoami2. Switch User to root su Or su rootcat &gt; crontab.cron * * * * echo One Minute Past. * * * 1 echo Today is Monday. ^D 3. Schedule jobs in file crontab.cron to be executed on a period
Bowling Green - CS - 3320
Pratice 5Question 1 (15) Describe the meaning for each regular expression below. For each expression, give 3 different examples that match the pattern. a) /^[A-Z].$/ ANSWER: A single uppercase letter at the beginning of a line followed by two of any
Bowling Green - CS - 3320
Tom231215Jack301529Jane3125 19
Bowling Green - CS - 3320
test Command-Numbers-n1 -eq n2 True if number n1 is equal to number n2n1 -le n2 True if number n1 is less than or equal to number n2n1 -ge n2 True if number n1 is greater than or equal to number n2n1 -lt n2 True if number n1 is less than n
Bowling Green - CS - 3320
-bash-3.00$ cat project1.sh#/bin/sh#Project1 CSC 3320echo &quot;Name Exam1 Exam2 Exam3 Total Grade&quot; &gt; finalgrades.txtawk -f 12.awk grades.txt | sort +4 -5 -r &gt; finalgrades.txt-bash-3.00$ cat 12.awk#BEGIN {printf &quot;Name\tExam1\tExam2
Bowling Green - CSC - 8820
CSc 8820 Advanced Graphics AlgorithmsYing Zhu Georgia State UniversityLecture 19Overview of 3D ModelingOutlineThe 3D computer graphics process The 3D modeling techniques Surface models Polygon mesh models Subdivision surfaces Parametric curv
Bowling Green - CSC - 2310
pet +type (cat, dog, fish) + age + color + name + owner + appetiteLevel =&gt;initial = 5 [0,1 . . .,10] if appetitelevel &lt; 0 =&gt; no response + mood [sad&lt;upset&lt;angry&lt;happy&lt;excited] -sad if appetiteLevel is in 0-1 -excited if appetiteLevel &gt; 8 + is active?
Bowling Green - CSC - 2310
CSc2310, Spring 06Assignment #1 Due: Feb. 02, 2006Problem: Write a Java program, called Bear.java, using displayable character to display the following ASCII valentine teddy bear. Your teddy bear must be displayed 10 spaces from the left screen.
Bowling Green - CSC - 2310
CSC2310 Intro to Computer Science In class exerciseSpring, 2006 Ken Nguyena. Develop a class called PhoneRecord containing two data fields: name and phone number b. Write a program to prompt the user to fill an array of PhoneRecords (max 10 recor
Bowling Green - CSC - 2310
Chapter 3: Classes and ObjectsChapter 3Classes and ObjectsJava ProgrammingFROM THE BEGINNING1Copyright 2000 W. W. Norton &amp; Company.Chapter 3: Classes and Objects3.1 Objects as Models A program can be thought of as a model of reality,
Bowling Green - CSC - 2310
Chapter 7: Class Variables and MethodsChapter 7Class Variables and MethodsJava Pr ogr ammingF ROM T H E BEGI N N I N G1Copyright 2000 W. W. Norton &amp; Company.Chapter 7: Class Variables and Methods7.1 Class Methods Versus Instance Metho
Bowling Green - CSC - 2310
Chapter 8: More Control StructuresChapter 8More Control StructuresJava ProgrammingFROM THE BEGI NNI NG1Copyright 2000 W. W. Norton &amp; Company.Chapter 8: More Control Structures8.1 Exceptions When a Java program performs an illegal ope
Bowling Green - CSC - 2310
Chapter 9: Primitive TypesChapter 9Primitive TypesJava ProgrammingFROM THE BEGINNING1Copyright 2000 W. W. Norton &amp; Company.Chapter 9: Primitive Types9.1 Types Numbers, like all data, must be stored in computer memory. Computer memor
Bowling Green - CSC - 2311
Copyright 2003 Pearson Education, Inc.Slide 1Chapter 11Strings and VectorsCreated by David Mann, North Idaho CollegeCopyright 2003 Pearson Education, Inc.Slide 2Overview An Array Type for Strings (11.1) The Standard string class (11.
Bowling Green - CSC - 2311
Copyright 2003 Pearson Education, Inc.Slide 1Chapter 13RecursionCreated by David Mann, North Idaho CollegeCopyright 2003 Pearson Education, Inc.Slide 2Overview Recursive Functions for Tasks(13.1) Recursive Functions for Values (13.2)
Bowling Green - CSC - 3320
CSc 3320 Ken D. Nguyen Summer, 2001 Quiz 3 July 25th, 2001 Name:_ 1. What is the major difference between fgrep and grep?2. Besides tar utility, what are the other two common utilities that are used for archiving data and structures?3. Give a com
Bowling Green - CSC - 2311
Practice 1Due next class (Tuesday 24th)Write a game program that allows a user to guess the day of your birthday. Add logic to your program to limit the guesses between 1 and 31, since the days of a month are in this limit. Print out appropriate
Bowling Green - CSC - 2311
Parameter passing by value or reference C+ supports parameter passing using three mechanisms: by value: a private copy of the argument is passed to the called function. by address: the address of the argument is passed to the called function (ie
Bowling Green - CSC - 2310
InstallationUnzip the installation file Setup.exe of JCreator in a temporary directory and follow the steps for the Setup Wizard. Setting up JCreator with the Java Development Kit (JDK) Make sure you have the Java Development Kit suite installed fro
Bowling Green - CSC - 2310
Java Software SolutionsLewis and LoftusObjects An object has: state - descriptive characteristics behaviors - what it can do (or be done to it) For example, a particular bank account has an account number has a current balance can be dep
Bowling Green - CSC - 2310
Coordinate System Note that the basic AWT coordinate system for the Graphics context methods goes as follows: Origin (0,0)- top left hand corner x (in pixels) - increases towards the right o Maximum x = width - 1 y (in pixels) - increases towards
Bowling Green - CSC - 2310
INHERITANCE Class Hierarchies Extending Objects Abstract Methods Abstract Classes Overriding Methods protectedInheritance1 of 30September 21, 2004Introduction In real situations either when modeling real world objects such as vehicles
Wisc Stout - CHEM - 135
Wisc Stout - CHEM - 135
Wisc Stout - CHEM - 135
Wisc Stout - CHEM - 135
Wisc Stout - CHEM - 135
Wisc Stout - CHEM - 135
2. The decomposition of hydrogen peroxide was studied and produced the following kinetic data: 2H2O2 O2 + 2H2O Time 0 120 300 600 1200 1800 2400 3000 3600 [H2O2] 1 0.91 0.78 0.59 0.37 0.22 0.13 0.08 0.05 Time 0 120 300 600 1200 1800 2400 3000 360
Minnesota - HINC - 0024
Review of Film Production Pert ChartBy Matthew Decker The pert chart that was viewed was a good example because it shows a couple different branches on the pert chart. The pert chart reviewed, explained the steps and milestones in making a film. The
Minnesota - HINC - 0024
Review of Petras PERT ChartBy Gregory Hinck Petras PERT chart is a nice and concise example of a good PERT chart. The chart use the information from the Work Breakdown Structure (WBS) that can be found on the Document XI. The chart list all tasks is
N.C. State - PYTHON - 201
optparseReplacement for getopt, originally developed as Optik. from optparse import OptionParser op = OptionParser() op.add_option('-i', '-input', action='store', type='string', dest='input', help='set input filena
N.C. State - PYTHON - 201
Resources O'Reillys web site (I don't care for this one)http:/www.onlamp.com/python/Biology and Pythonhttp:/biopython.org/All the power of python with all the incompatibility of java.http:/www.jython.org/Python makes windows suck a little
N.C. State - PYTHON - 201
Resources Beginning pythonhttp:/www.uselesspython.com/index.htmlPython Bloghttp:/www.deadlybloodyserious.com/PythonIntroduction to Numerical Pythonhttp:/www.onlamp.com/pub/a/python/2000 /05/03/numerically.htmlPsyco (JIT) http:/psyco.sourc
W. Kentucky - CSC - 462
Since ILP has inherent limitations, can we exploit multithreading? a thread is defined as a separate process with its own instructions and data this is unlike the traditional (OS) definition of a thread which shares instructions with other threads
W. Kentucky - CSC - 425
CSC 425/525 Homework #6 (Chapter 10) Due: Wednesday, April 1 Word process all answers. Figures may be hand drawn. Undergraduates answer question 1 and any three additional questions, all five questions for extra credit. Graduate students answer all f
W. Kentucky - CSC - 362
CSC 362 Midterm 1 answer key 1) Convert 11101010 to decimal assuming the following representations. a. Unsigned magnitude = 128 + 64 + 32 + 8 + 2 = 234 b. Signed magnitude = -(64 + 32 + 8 + 2) = -106 c. One's complement - (00010101) = -(16 + 4 + 1)
Grinnell - MAT - 115
Chapter 13 Confidence Intervals for the mean California SAT Data There are 250,000 California High School Students We did a SRS and selected 500 to take the test. With a mean of X = 461 What if we had selected a different 500 students? Would the sa
Grinnell - MAT - 115
Normal, knownH1: oX - oH1: &lt; o or H1: &gt; oX - o/ nNormal, unknownz 2/ nX - o s/ n X 1 - X 2 -# 2 2 s1 s 2 + n1 n 2z ( ) t n -1( )X - o s/ nt n -1 2tn small -1 2Normal andH1: 1 - 2 #X 1 - X 2 -# s s + n1
Grinnell - MAT - 115
Analysis of variance (ANOVA) is similar to regression in that it is used to investigate and model the relationship between a response variable and one or more independent variables. However, analysis of variance differs from regression in two ways: t
Grinnell - MAT - 115
Common Questions1) I have numeric data in a column, but the column number appears with a T, indicating that my data is treated as text. How can I change it so it is recognized as numeric?Minitab identifies a column as either text, numeric, or dat