CS240: Programming in C. Lecture 12: Polymorphic Sorting
|
|
- Nelson Bryant
- 6 years ago
- Views:
Transcription
1 CS240: Programmng n C ecture 12: Polymorphc Sortng
2 Sortng Gven a collecton of tems and a total order over them, sort the collecton under ths order. Total order: every tem s ordered wth respect to every other tme n the collecton Gven an array of numbers, sort the numbers n ascendng order sort n descendng order sort odd before even, wth each sub-collecton respectng an orderng Gven an array of strngs, sort accordng to lexographc orderng Gven an array of structures, sort the structures based on the value of the feld named ndex Gven an array of arrays, sort the lsts based on the value of ther least element
3 Key Observaton The code necessary to perform the sort swappng elements, rearrangng the array as necessary works ndependently of the type of the elements beng sorted. As long as the elements have a comparator that understands orderng, the same sortng functon can be used to sort dfferent knds of elements Polymorphsm: poly : many morphsm : form 3
4 The Swap functon vod swap(vod *v[], nt, nt j) vod *temp; A vod type specfes an empty set of values. temp = v[]; v[] = v[j]; v[j] = temp; An expresson that has a type denotes an expresson where the value of that type s not requred. Any ponter to an object can be converted to vod * wthout loss of nformaton, and can be recovered to the orgnal ponter type. Thus, vod s C s mechansm to support a generc or polymorphc type A functon wth vod * arguments thus accepts ponters of any type 4
5 Qucksort Start wth: End wth: Basc dea: pvot = 25 Pck an element (hopefully close to the mddle) and sort around t pvot = 25 Start examnng elements to the rght of the hole untl we fnd an element smaller than the pvot V V
6 Qucksort After processng 06, pvot = 25 At the end of the process, we have: pvot = 25 epeat the process for each of the two subarrays ecurson ends wth a partton has only two elements 6
7 In C... vod qsort(vod *v[], nt left, nt rght, nt (*comp)(vod *, vod *)) nt, last; vod swap(vod *v[], nt, nt); f (left >=rght) return; swap(v, left, (left + rght)/2); for ( = left+1; <= rght; ++) f ((*comp)(v[], v[left])) < 0 call the functon swap(v, ++last,); ponted to by comp qsort(v, last+1, rght, comp) comp s a ponter to a functon that returns an nt, and takes two objects of unspecfed type swap s a functon that takes an array as ts frst argument whose elements are ponters of unspecfed type 7
8 Invokng qucksort char *lneptr[maxines] /* ponters to text lnes */ nt readlnes(char *lneptr[], nt nlnes); vod wrtelnes(char *lneptr[], nt nlnes); vod qsort(vod *lneptr[], nt left, nt rght, nt (*comp)(vod *, vod *)); nt numcmp(char *, char *); nt numerc = address of functon qsort((vod **) lneptr, 0, nlnes-1, (nt (*)(vod *, vod *)) numerc? numcmp: strcmp)) 8
9 Sortng procedure vod qsort(vod *v[], nt left, nt rght, nt (*comp)(vod *, vod *)) nt, last; vod swap(vod *v[], nt, nt); f (left >=rght) return; swap(v, left, (left + rght)/2); for ( = left+1; <= rght; ++) f ((*comp)(v[], v[left])) < 0 swap(v, ++last,); qsort(v, last+1, rght, comp)
10 Sortng procedure vod qsort(vod *v[], nt left, nt rght, nt (*comp)(vod *, vod *)) nt, last; vod swap(vod *v[], nt, nt); f (left >=rght) return; swap(v, left, (left + rght)/2); for ( = left+1; <= rght; ++) f ((*comp)(v[], v[left])) < 0 swap(v, ++last,); qsort(v, last+1, rght, comp)
11 Sortng procedure vod qsort(vod *v[], nt left, nt rght, nt (*comp)(vod *, vod *)) nt, last; vod swap(vod *v[], nt, nt); f (left >=rght) return; swap(v, left, (left + rght)/2); for ( = left+1; <= rght; ++) f ((*comp)(v[], v[left])) < 0 swap(v, ++last,); qsort(v, last+1, rght, comp)
12 Sortng procedure vod qsort(vod *v[], nt left, nt rght, nt (*comp)(vod *, vod *)) nt, last; vod swap(vod *v[], nt, nt); f (left >=rght) return; swap(v, left, (left + rght)/2); for ( = left+1; <= rght; ++) f ((*comp)(v[], v[left])) < 0 swap(v, ++last,); qsort(v, last+1, rght, comp) pvot
13 Sortng procedure vod qsort(vod *v[], nt left, nt rght, nt (*comp)(vod *, vod *)) nt, last; vod swap(vod *v[], nt, nt); f (left >=rght) return; swap(v, left, (left + rght)/2); for ( = left+1; <= rght; ++) f ((*comp)(v[], v[left])) < 0 swap(v, ++last,); qsort(v, last+1, rght, comp) pvot
14 Sortng procedure vod qsort(vod *v[], nt left, nt rght, nt (*comp)(vod *, vod *)) nt, last; vod swap(vod *v[], nt, nt); f (left >=rght) return; swap(v, left, (left + rght)/2); for ( = left+1; <= rght; ++) f ((*comp)(v[], v[left])) < 0 swap(v, ++last,); qsort(v, last+1, rght, comp) pvot
15 Sortng procedure vod qsort(vod *v[], nt left, nt rght, nt (*comp)(vod *, vod *)) nt, last; vod swap(vod *v[], nt, nt); f (left >=rght) return; swap(v, left, (left + rght)/2); for ( = left+1; <= rght; ++) f ((*comp)(v[], v[left])) < 0 swap(v, ++last,); qsort(v, last+1, rght, comp) pvot
16 Sortng procedure vod qsort(vod *v[], nt left, nt rght, nt (*comp)(vod *, vod *)) nt, last; vod swap(vod *v[], nt, nt); f (left >=rght) return; swap(v, left, (left + rght)/2); for ( = left+1; <= rght; ++) f ((*comp)(v[], v[left])) < 0 swap(v, ++last,); qsort(v, last+1, rght, comp) pvot
17 Sortng procedure vod qsort(vod *v[], nt left, nt rght, nt (*comp)(vod *, vod *)) nt, last; vod swap(vod *v[], nt, nt); f (left >=rght) return; swap(v, left, (left + rght)/2); for ( = left+1; <= rght; ++) f ((*comp)(v[], v[left])) < 0 swap(v, ++last,); qsort(v, last+1, rght, comp) pvot
18 Sortng procedure vod qsort(vod *v[], nt left, nt rght, nt (*comp)(vod *, vod *)) nt, last; vod swap(vod *v[], nt, nt); f (left >=rght) return; swap(v, left, (left + rght)/2); for ( = left+1; <= rght; ++) f ((*comp)(v[], v[left])) < 0 swap(v, ++last,); qsort(v, last+1, rght, comp) pvot
19 Sortng procedure vod qsort(vod *v[], nt left, nt rght, nt (*comp)(vod *, vod *)) nt, last; vod swap(vod *v[], nt, nt); f (left >=rght) return; swap(v, left, (left + rght)/2); for ( = left+1; <= rght; ++) f ((*comp)(v[], v[left])) < 0 swap(v, ++last,); qsort(v, last+1, rght, comp) pvot
20 Sortng procedure vod qsort(vod *v[], nt left, nt rght, nt (*comp)(vod *, vod *)) nt, last; vod swap(vod *v[], nt, nt); f (left >=rght) return; swap(v, left, (left + rght)/2); for ( = left+1; <= rght; ++) f ((*comp)(v[], v[left])) < 0 swap(v, ++last,); qsort(v, last+1, rght, comp) pvot
21 Sortng procedure vod qsort(vod *v[], nt left, nt rght, nt (*comp)(vod *, vod *)) nt, last; vod swap(vod *v[], nt, nt); f (left >=rght) return; swap(v, left, (left + rght)/2); for ( = left+1; <= rght; ++) f ((*comp)(v[], v[left])) < 0 swap(v, ++last,); qsort(v, last+1, rght, comp) pvot
22 Sortng procedure vod qsort(vod *v[], nt left, nt rght, nt (*comp)(vod *, vod *)) nt, last; vod swap(vod *v[], nt, nt); f (left >=rght) return; swap(v, left, (left + rght)/2); for ( = left+1; <= rght; ++) f ((*comp)(v[], v[left])) < 0 swap(v, ++last,); qsort(v, last+1, rght, comp) pvot
23 Sortng procedure vod qsort(vod *v[], nt left, nt rght, nt (*comp)(vod *, vod *)) nt, last; vod swap(vod *v[], nt, nt); f (left >=rght) return; swap(v, left, (left + rght)/2); for ( = left+1; <= rght; ++) f ((*comp)(v[], v[left])) < 0 swap(v, ++last,); qsort(v, last+1, rght, comp) pvot
24 Sortng procedure vod qsort(vod *v[], nt left, nt rght, nt (*comp)(vod *, vod *)) nt, last; vod swap(vod *v[], nt, nt); f (left >=rght) return; swap(v, left, (left + rght)/2); for ( = left+1; <= rght; ++) f ((*comp)(v[], v[left])) < 0 swap(v, ++last,); qsort(v, last+1, rght, comp) pvot
25 Sortng procedure vod qsort(vod *v[], nt left, nt rght, nt (*comp)(vod *, vod *)) nt, last; vod swap(vod *v[], nt, nt); f (left >=rght) return; swap(v, left, (left + rght)/2); for ( = left+1; <= rght; ++) f ((*comp)(v[], v[left])) < 0 swap(v, ++last,); qsort(v, last+1, rght, comp) pvot
26 Sortng procedure vod qsort(vod *v[], nt left, nt rght, nt (*comp)(vod *, vod *)) nt, last; vod swap(vod *v[], nt, nt); f (left >=rght) return; swap(v, left, (left + rght)/2); for ( = left+1; <= rght; ++) f ((*comp)(v[], v[left])) < 0 swap(v, ++last,); qsort(v, last+1, rght, comp) pvot
27 Sortng procedure vod qsort(vod *v[], nt left, nt rght, nt (*comp)(vod *, vod *)) nt, last; vod swap(vod *v[], nt, nt); f (left >=rght) return; swap(v, left, (left + rght)/2); for ( = left+1; <= rght; ++) f ((*comp)(v[], v[left])) < 0 swap(v, ++last,); qsort(v, last+1, rght, comp) pvot
Searching & Sorting. Definitions of Search and Sort. Linear Search in C++ Linear Search. Week 11. index to the item, or -1 if not found.
Searchng & Sortng Wee 11 Gadds: 8, 19.6,19.8 CS 5301 Sprng 2014 Jll Seaman 1 Defntons of Search and Sort Search: fnd a gven tem n a lst, return the ndex to the tem, or -1 f not found. Sort: rearrange the
More informationCSE 326: Data Structures Quicksort Comparison Sorting Bound
CSE 326: Data Structures Qucksort Comparson Sortng Bound Steve Setz Wnter 2009 Qucksort Qucksort uses a dvde and conquer strategy, but does not requre the O(N) extra space that MergeSort does. Here s the
More informationCSE 326: Data Structures Quicksort Comparison Sorting Bound
CSE 326: Data Structures Qucksort Comparson Sortng Bound Bran Curless Sprng 2008 Announcements (5/14/08) Homework due at begnnng of class on Frday. Secton tomorrow: Graded homeworks returned More dscusson
More informationQuicksort. Part 1: Understanding Quicksort
Qucksort Part 1: Understandng Qucksort https://www.youtube.com/watch?v=ywwby6j5gz8 Qucksort A practcal algorthm The hdden constants are small (hdden by Bg-O) Succnct algorthm The runnng tme = O(n lg n)
More informationSorting Review. Sorting. Comparison Sorting. CSE 680 Prof. Roger Crawfis. Assumptions
Sortng Revew Introducton to Algorthms Qucksort CSE 680 Prof. Roger Crawfs Inserton Sort T(n) = Θ(n 2 ) In-place Merge Sort T(n) = Θ(n lg(n)) Not n-place Selecton Sort (from homework) T(n) = Θ(n 2 ) In-place
More informationCSCI 104 Sorting Algorithms. Mark Redekopp David Kempe
CSCI 104 Sortng Algorthms Mark Redekopp Davd Kempe Algorthm Effcency SORTING 2 Sortng If we have an unordered lst, sequental search becomes our only choce If we wll perform a lot of searches t may be benefcal
More informationToday s Outline. Sorting: The Big Picture. Why Sort? Selection Sort: Idea. Insertion Sort: Idea. Sorting Chapter 7 in Weiss.
Today s Outlne Sortng Chapter 7 n Wess CSE 26 Data Structures Ruth Anderson Announcements Wrtten Homework #6 due Frday 2/26 at the begnnng of lecture Proect Code due Mon March 1 by 11pm Today s Topcs:
More informationSequential search. Building Java Programs Chapter 13. Sequential search. Sequential search
Sequental search Buldng Java Programs Chapter 13 Searchng and Sortng sequental search: Locates a target value n an array/lst by examnng each element from start to fnsh. How many elements wll t need to
More informationInsertion Sort. Divide and Conquer Sorting. Divide and Conquer. Mergesort. Mergesort Example. Auxiliary Array
Inserton Sort Dvde and Conquer Sortng CSE 6 Data Structures Lecture 18 What f frst k elements of array are already sorted? 4, 7, 1, 5, 1, 16 We can shft the tal of the sorted elements lst down and then
More informationSorting. Sorting. Why Sort? Consistent Ordering
Sortng CSE 6 Data Structures Unt 15 Readng: Sectons.1-. Bubble and Insert sort,.5 Heap sort, Secton..6 Radx sort, Secton.6 Mergesort, Secton. Qucksort, Secton.8 Lower bound Sortng Input an array A of data
More informationCS1100 Introduction to Programming
Factoral (n) Recursve Program fact(n) = n*fact(n-) CS00 Introducton to Programmng Recurson and Sortng Madhu Mutyam Department of Computer Scence and Engneerng Indan Insttute of Technology Madras nt fact
More informationSorting: The Big Picture. The steps of QuickSort. QuickSort Example. QuickSort Example. QuickSort Example. Recursive Quicksort
Sortng: The Bg Pcture Gven n comparable elements n an array, sort them n an ncreasng (or decreasng) order. Smple algorthms: O(n ) Inserton sort Selecton sort Bubble sort Shell sort Fancer algorthms: O(n
More informationSorting and Algorithm Analysis
Unt 7 Sortng and Algorthm Analyss Computer Scence S-111 Harvard Unversty Davd G. Sullvan, Ph.D. Sortng an Array of Integers 0 1 2 n-2 n-1 arr 15 7 36 40 12 Ground rules: sort the values n ncreasng order
More informationLife Tables (Times) Summary. Sample StatFolio: lifetable times.sgp
Lfe Tables (Tmes) Summary... 1 Data Input... 2 Analyss Summary... 3 Survval Functon... 5 Log Survval Functon... 6 Cumulatve Hazard Functon... 7 Percentles... 7 Group Comparsons... 8 Summary The Lfe Tables
More informationFor instance, ; the five basic number-sets are increasingly more n A B & B A A = B (1)
Secton 1.2 Subsets and the Boolean operatons on sets If every element of the set A s an element of the set B, we say that A s a subset of B, or that A s contaned n B, or that B contans A, and we wrte A
More informationProgramming in Fortran 90 : 2017/2018
Programmng n Fortran 90 : 2017/2018 Programmng n Fortran 90 : 2017/2018 Exercse 1 : Evaluaton of functon dependng on nput Wrte a program who evaluate the functon f (x,y) for any two user specfed values
More informationNews. Recap: While Loop Example. Reading. Recap: Do Loop Example. Recap: For Loop Example
Unversty of Brtsh Columba CPSC, Intro to Computaton Jan-Apr Tamara Munzner News Assgnment correctons to ASCIIArtste.java posted defntely read WebCT bboards Arrays Lecture, Tue Feb based on sldes by Kurt
More informationSorting. Sorted Original. index. index
1 Unt 16 Sortng 2 Sortng Sortng requres us to move data around wthn an array Allows users to see and organze data more effcently Behnd the scenes t allows more effectve searchng of data There are MANY
More informationKent State University CS 4/ Design and Analysis of Algorithms. Dept. of Math & Computer Science LECT-16. Dynamic Programming
CS 4/560 Desgn and Analyss of Algorthms Kent State Unversty Dept. of Math & Computer Scence LECT-6 Dynamc Programmng 2 Dynamc Programmng Dynamc Programmng, lke the dvde-and-conquer method, solves problems
More informationCHARUTAR VIDYA MANDAL S SEMCOM Vallabh Vidyanagar
CHARUTAR VIDYA MANDAL S SEMCOM Vallabh Vdyanagar Faculty Name: Am D. Trved Class: SYBCA Subject: US03CBCA03 (Advanced Data & Fle Structure) *UNIT 1 (ARRAYS AND TREES) **INTRODUCTION TO ARRAYS If we want
More informationLOOP ANALYSIS. The second systematic technique to determine all currents and voltages in a circuit
LOOP ANALYSS The second systematic technique to determine all currents and voltages in a circuit T S DUAL TO NODE ANALYSS - T FRST DETERMNES ALL CURRENTS N A CRCUT AND THEN T USES OHM S LAW TO COMPUTE
More information11. HARMS How To: CSV Import
and Rsk System 11. How To: CSV Import Preparng the spreadsheet for CSV Import Refer to the spreadsheet template to ad algnng spreadsheet columns wth Data Felds. The spreadsheet s shown n the Appendx, an
More informationCS221: Algorithms and Data Structures. Priority Queues and Heaps. Alan J. Hu (Borrowing slides from Steve Wolfman)
CS: Algorthms and Data Structures Prorty Queues and Heaps Alan J. Hu (Borrowng sldes from Steve Wolfman) Learnng Goals After ths unt, you should be able to: Provde examples of approprate applcatons for
More informationAnalysis of Continuous Beams in General
Analyss of Contnuous Beams n General Contnuous beams consdered here are prsmatc, rgdly connected to each beam segment and supported at varous ponts along the beam. onts are selected at ponts of support,
More informationPriority queues and heaps Professors Clark F. Olson and Carol Zander
Prorty queues and eaps Professors Clark F. Olson and Carol Zander Prorty queues A common abstract data type (ADT) n computer scence s te prorty queue. As you mgt expect from te name, eac tem n te prorty
More informationCMPS 10 Introduction to Computer Science Lecture Notes
CPS 0 Introducton to Computer Scence Lecture Notes Chapter : Algorthm Desgn How should we present algorthms? Natural languages lke Englsh, Spansh, or French whch are rch n nterpretaton and meanng are not
More informationExercises (Part 4) Introduction to R UCLA/CCPR. John Fox, February 2005
Exercses (Part 4) Introducton to R UCLA/CCPR John Fox, February 2005 1. A challengng problem: Iterated weghted least squares (IWLS) s a standard method of fttng generalzed lnear models to data. As descrbed
More informationDesign and Analysis of Algorithms
Desgn and Analyss of Algorthms Heaps and Heapsort Reference: CLRS Chapter 6 Topcs: Heaps Heapsort Prorty queue Huo Hongwe Recap and overvew The story so far... Inserton sort runnng tme of Θ(n 2 ); sorts
More informationMachine Learning. Topic 6: Clustering
Machne Learnng Topc 6: lusterng lusterng Groupng data nto (hopefully useful) sets. Thngs on the left Thngs on the rght Applcatons of lusterng Hypothess Generaton lusters mght suggest natural groups. Hypothess
More informationAn Optimal Algorithm for Prufer Codes *
J. Software Engneerng & Applcatons, 2009, 2: 111-115 do:10.4236/jsea.2009.22016 Publshed Onlne July 2009 (www.scrp.org/journal/jsea) An Optmal Algorthm for Prufer Codes * Xaodong Wang 1, 2, Le Wang 3,
More informationMore on Sorting: Quick Sort and Heap Sort
More on Sortng: Quck Sort and Heap Sort Antono Carzanga Faculty of Informatcs Unversty of Lugano October 12, 2007 c 2006 Antono Carzanga 1 Another dvde-and-conuer sortng algorthm The heap Heap sort Outlne
More informationEsc101 Lecture 1 st April, 2008 Generating Permutation
Esc101 Lecture 1 Aprl, 2008 Generatng Permutaton In ths class we wll look at a problem to wrte a program that takes as nput 1,2,...,N and prnts out all possble permutatons of the numbers 1,2,...,N. For
More informationIntro. Iterators. 1. Access
Intro Ths mornng I d lke to talk a lttle bt about s and s. We wll start out wth smlartes and dfferences, then we wll see how to draw them n envronment dagrams, and we wll fnsh wth some examples. Happy
More informationHigh level vs Low Level. What is a Computer Program? What does gcc do for you? Program = Instructions + Data. Basic Computer Organization
What s a Computer Program? Descrpton of algorthms and data structures to acheve a specfc ojectve Could e done n any language, even a natural language lke Englsh Programmng language: A Standard notaton
More informationRESISTIVE CIRCUITS MULTI NODE/LOOP CIRCUIT ANALYSIS
RESSTE CRCUTS MULT NODE/LOOP CRCUT ANALYSS DEFNNG THE REFERENCE NODE S TAL 4 THESTATEMENT 4 S MEANNGLES UNTL THE REFERENCE PONT S DEFNED BY CONENTON THE GROUND SYMBOL SPECFES THE REFERENCE PONT. ALL NODE
More informationIntroduction to Programming. Lecture 13: Container data structures. Container data structures. Topics for this lecture. A basic issue with containers
1 2 Introducton to Programmng Bertrand Meyer Lecture 13: Contaner data structures Last revsed 1 December 2003 Topcs for ths lecture 3 Contaner data structures 4 Contaners and genercty Contan other objects
More informationNotes on Organizing Java Code: Packages, Visibility, and Scope
Notes on Organzng Java Code: Packages, Vsblty, and Scope CS 112 Wayne Snyder Java programmng n large measure s a process of defnng enttes (.e., packages, classes, methods, or felds) by name and then usng
More informationSynthesizer 1.0. User s Guide. A Varying Coefficient Meta. nalytic Tool. Z. Krizan Employing Microsoft Excel 2007
Syntheszer 1.0 A Varyng Coeffcent Meta Meta-Analytc nalytc Tool Employng Mcrosoft Excel 007.38.17.5 User s Gude Z. Krzan 009 Table of Contents 1. Introducton and Acknowledgments 3. Operatonal Functons
More informationNon-Split Restrained Dominating Set of an Interval Graph Using an Algorithm
Internatonal Journal of Advancements n Research & Technology, Volume, Issue, July- ISS - on-splt Restraned Domnatng Set of an Interval Graph Usng an Algorthm ABSTRACT Dr.A.Sudhakaraah *, E. Gnana Deepka,
More informationLoop Transformations, Dependences, and Parallelization
Loop Transformatons, Dependences, and Parallelzaton Announcements Mdterm s Frday from 3-4:15 n ths room Today Semester long project Data dependence recap Parallelsm and storage tradeoff Scalar expanson
More informationThe Greedy Method. Outline and Reading. Change Money Problem. Greedy Algorithms. Applications of the Greedy Strategy. The Greedy Method Technique
//00 :0 AM Outlne and Readng The Greedy Method The Greedy Method Technque (secton.) Fractonal Knapsack Problem (secton..) Task Schedulng (secton..) Mnmum Spannng Trees (secton.) Change Money Problem Greedy
More informationCompiler Design. Spring Register Allocation. Sample Exercises and Solutions. Prof. Pedro C. Diniz
Compler Desgn Sprng 2014 Regster Allocaton Sample Exercses and Solutons Prof. Pedro C. Dnz USC / Informaton Scences Insttute 4676 Admralty Way, Sute 1001 Marna del Rey, Calforna 90292 pedro@s.edu Regster
More informationOutline. Midterm Review. Declaring Variables. Main Variable Data Types. Symbolic Constants. Arithmetic Operators. Midterm Review March 24, 2014
Mdterm Revew March 4, 4 Mdterm Revew Larry Caretto Mechancal Engneerng 9 Numercal Analyss of Engneerng Systems March 4, 4 Outlne VBA and MATLAB codng Varable types Control structures (Loopng and Choce)
More information9. BASIC programming: Control and Repetition
Am: In ths lesson, you wll learn: H. 9. BASIC programmng: Control and Repetton Scenaro: Moz s showng how some nterestng patterns can be generated usng math. Jyot [after seeng the nterestng graphcs]: Usng
More informationDijkstra s Single Source Algorithm. All-Pairs Shortest Paths. Dynamic Programming Solution. Performance. Decision Sequence.
All-Pars Shortest Paths Gven an n-vertex drected weghted graph, fnd a shortest path from vertex to vertex for each of the n vertex pars (,). Dstra s Sngle Source Algorthm Use Dstra s algorthm n tmes, once
More informationBiostatistics 615/815
The E-M Algorthm Bostatstcs 615/815 Lecture 17 Last Lecture: The Smplex Method General method for optmzaton Makes few assumptons about functon Crawls towards mnmum Some recommendatons Multple startng ponts
More informationHermite Splines in Lie Groups as Products of Geodesics
Hermte Splnes n Le Groups as Products of Geodescs Ethan Eade Updated May 28, 2017 1 Introducton 1.1 Goal Ths document defnes a curve n the Le group G parametrzed by tme and by structural parameters n the
More informationParallel Numerics. 1 Preconditioning & Iterative Solvers (From 2016)
Technsche Unverstät München WSe 6/7 Insttut für Informatk Prof. Dr. Thomas Huckle Dpl.-Math. Benjamn Uekermann Parallel Numercs Exercse : Prevous Exam Questons Precondtonng & Iteratve Solvers (From 6)
More informationLecture #15 Lecture Notes
Lecture #15 Lecture Notes The ocean water column s very much a 3-D spatal entt and we need to represent that structure n an economcal way to deal wth t n calculatons. We wll dscuss one way to do so, emprcal
More informationSubspace clustering. Clustering. Fundamental to all clustering techniques is the choice of distance measure between data points;
Subspace clusterng Clusterng Fundamental to all clusterng technques s the choce of dstance measure between data ponts; D q ( ) ( ) 2 x x = x x, j k = 1 k jk Squared Eucldean dstance Assumpton: All features
More informationPerformance Evaluation of Information Retrieval Systems
Why System Evaluaton? Performance Evaluaton of Informaton Retreval Systems Many sldes n ths secton are adapted from Prof. Joydeep Ghosh (UT ECE) who n turn adapted them from Prof. Dk Lee (Unv. of Scence
More informationCluster Analysis of Electrical Behavior
Journal of Computer and Communcatons, 205, 3, 88-93 Publshed Onlne May 205 n ScRes. http://www.scrp.org/ournal/cc http://dx.do.org/0.4236/cc.205.350 Cluster Analyss of Electrcal Behavor Ln Lu Ln Lu, School
More informationCourse Introduction. Algorithm 8/31/2017. COSC 320 Advanced Data Structures and Algorithms. COSC 320 Advanced Data Structures and Algorithms
Course Introducton Course Topcs Exams, abs, Proects A quc loo at a few algorthms 1 Advanced Data Structures and Algorthms Descrpton: We are gong to dscuss algorthm complexty analyss, algorthm desgn technques
More informationSupport Vector Machines
/9/207 MIST.6060 Busness Intellgence and Data Mnng What are Support Vector Machnes? Support Vector Machnes Support Vector Machnes (SVMs) are supervsed learnng technques that analyze data and recognze patterns.
More informationETAtouch RESTful Webservices
ETAtouch RESTful Webservces Verson 1.1 November 8, 2012 Contents 1 Introducton 3 2 The resource /user/ap 6 2.1 HTTP GET................................... 6 2.2 HTTP POST..................................
More informationCE 221 Data Structures and Algorithms
CE 1 ata Structures and Algorthms Chapter 4: Trees BST Text: Read Wess, 4.3 Izmr Unversty of Economcs 1 The Search Tree AT Bnary Search Trees An mportant applcaton of bnary trees s n searchng. Let us assume
More informationAssembler. Building a Modern Computer From First Principles.
Assembler Buldng a Modern Computer From Frst Prncples www.nand2tetrs.org Elements of Computng Systems, Nsan & Schocken, MIT Press, www.nand2tetrs.org, Chapter 6: Assembler slde Where we are at: Human Thought
More informationNUMERICAL SOLVING OPTIMAL CONTROL PROBLEMS BY THE METHOD OF VARIATIONS
ARPN Journal of Engneerng and Appled Scences 006-017 Asan Research Publshng Network (ARPN). All rghts reserved. NUMERICAL SOLVING OPTIMAL CONTROL PROBLEMS BY THE METHOD OF VARIATIONS Igor Grgoryev, Svetlana
More informationOutline. Self-Organizing Maps (SOM) US Hebbian Learning, Cntd. The learning rule is Hebbian like:
Self-Organzng Maps (SOM) Turgay İBRİKÇİ, PhD. Outlne Introducton Structures of SOM SOM Archtecture Neghborhoods SOM Algorthm Examples Summary 1 2 Unsupervsed Hebban Learnng US Hebban Learnng, Cntd 3 A
More informationA New Approach For the Ranking of Fuzzy Sets With Different Heights
New pproach For the ankng of Fuzzy Sets Wth Dfferent Heghts Pushpnder Sngh School of Mathematcs Computer pplcatons Thapar Unversty, Patala-7 00 Inda pushpndersnl@gmalcom STCT ankng of fuzzy sets plays
More informationOverview. CSC 2400: Computer Systems. Pointers in C. Pointers - Variables that hold memory addresses - Using pointers to do call-by-reference in C
CSC 2400: Comuter Systems Ponters n C Overvew Ponters - Varables that hold memory addresses - Usng onters to do call-by-reference n C Ponters vs. Arrays - Array names are constant onters Ponters and Strngs
More informationArrays as functions. Types. Multidimensional Arrays (row major, column major form) Java arrays
Louden Chpters 6,9 Types Dt Types nd Abstrct Dt Types 1 Arrys s functons f: U -> V (f U s ordnl type) f() rry C rrys types cn be wthout szes rry vrbles must hve fxed sze rry_mx( [], sze) // prmeters re
More informationHarvard University CS 101 Fall 2005, Shimon Schocken. Assembler. Elements of Computing Systems 1 Assembler (Ch. 6)
Harvard Unversty CS 101 Fall 2005, Shmon Schocken Assembler Elements of Computng Systems 1 Assembler (Ch. 6) Why care about assemblers? Because Assemblers employ some nfty trcks Assemblers are the frst
More informationMachine Learning: Algorithms and Applications
14/05/1 Machne Learnng: Algorthms and Applcatons Florano Zn Free Unversty of Bozen-Bolzano Faculty of Computer Scence Academc Year 011-01 Lecture 10: 14 May 01 Unsupervsed Learnng cont Sldes courtesy of
More informationA Comparison of Top-k Temporal Keyword Querying over Versioned Text Collections
A Comparson of Top-k Temporal Keyword Queryng over Versoned Text Collectons Wenyu Huo and Vassls J. Tsotras Department of Computer Scence and Engneerng Unversty of Calforna, Rversde Rversde, CA, USA {whuo,tsotras}@cs.ucr.edu
More informationAgenda & Reading. Simple If. Decision-Making Statements. COMPSCI 280 S1C Applications Programming. Programming Fundamentals
Agenda & Readng COMPSCI 8 SC Applcatons Programmng Programmng Fundamentals Control Flow Agenda: Decsonmakng statements: Smple If, Ifelse, nested felse, Select Case s Whle, DoWhle/Untl, For, For Each, Nested
More informationBrave New World Pseudocode Reference
Brave New World Pseudocode Reference Pseudocode s a way to descrbe how to accomplsh tasks usng basc steps lke those a computer mght perform. In ths week s lab, you'll see how a form of pseudocode can be
More informationLLVM passes and Intro to Loop Transformation Frameworks
LLVM passes and Intro to Loop Transformaton Frameworks Announcements Ths class s recorded and wll be n D2L panapto. No quz Monday after sprng break. Wll be dong md-semester class feedback. Today LLVM passes
More informationDijkstra s Single Source Algorithm. All-Pairs Shortest Paths. Dynamic Programming Solution. Performance
All-Pars Shortest Paths Gven an n-vertex drected weghted graph, fnd a shortest path from vertex to vertex for each of the n vertex pars (,). Dkstra s Sngle Source Algorthm Use Dkstra s algorthm n tmes,
More informationGaussian elimination. System of Linear Equations. Gaussian elimination. System of Linear Equations
Jord Cortadella Department of Computer Scence Introducton to Programmng Dept. CS, UPC 2 An essental algorthm n Lnear Algebra wth multple applcatons: Solvng lnear systems of equatons Fndng the nverse of
More informationMotivation. EE 457 Unit 4. Throughput vs. Latency. Performance Depends on View Point?! Computer System Performance. An individual user wants to:
4.1 4.2 Motvaton EE 457 Unt 4 Computer System Performance An ndvdual user wants to: Mnmze sngle program executon tme A datacenter owner wants to: Maxmze number of Mnmze ( ) http://e-tellgentnternetmarketng.com/webste/frustrated-computer-user-2/
More informationLoad Balancing for Hex-Cell Interconnection Network
Int. J. Communcatons, Network and System Scences,,, - Publshed Onlne Aprl n ScRes. http://www.scrp.org/journal/jcns http://dx.do.org/./jcns.. Load Balancng for Hex-Cell Interconnecton Network Saher Manaseer,
More informationSummarizing Data using Bottom-k Sketches
Summarzng Data usng Bottom-k Sketches Edth Cohen AT&T Labs Research 8 Park Avenue Florham Park, NJ 7932, USA edth@research.att.com Ham Kaplan School of Computer Scence Tel Avv Unversty Tel Avv, Israel
More informationAssignment # 2. Farrukh Jabeen Algorithms 510 Assignment #2 Due Date: June 15, 2009.
Farrukh Jabeen Algorthms 51 Assgnment #2 Due Date: June 15, 29. Assgnment # 2 Chapter 3 Dscrete Fourer Transforms Implement the FFT for the DFT. Descrbed n sectons 3.1 and 3.2. Delverables: 1. Concse descrpton
More informationSimulation: Solving Dynamic Models ABE 5646 Week 11 Chapter 2, Spring 2010
Smulaton: Solvng Dynamc Models ABE 5646 Week Chapter 2, Sprng 200 Week Descrpton Readng Materal Mar 5- Mar 9 Evaluatng [Crop] Models Comparng a model wth data - Graphcal, errors - Measures of agreement
More informationsuch that is accepted of states in , where Finite Automata Lecture 2-1: Regular Languages be an FA. A string is the transition function,
* Lecture - Regular Languages S Lecture - Fnte Automata where A fnte automaton s a -tuple s a fnte set called the states s a fnte set called the alphabet s the transton functon s the ntal state s the set
More information5 The Primal-Dual Method
5 The Prmal-Dual Method Orgnally desgned as a method for solvng lnear programs, where t reduces weghted optmzaton problems to smpler combnatoral ones, the prmal-dual method (PDM) has receved much attenton
More informationProblem Set 3 Solutions
Introducton to Algorthms October 4, 2002 Massachusetts Insttute of Technology 6046J/18410J Professors Erk Demane and Shaf Goldwasser Handout 14 Problem Set 3 Solutons (Exercses were not to be turned n,
More informationELEC 377 Operating Systems. Week 6 Class 3
ELEC 377 Operatng Systems Week 6 Class 3 Last Class Memory Management Memory Pagng Pagng Structure ELEC 377 Operatng Systems Today Pagng Szes Vrtual Memory Concept Demand Pagng ELEC 377 Operatng Systems
More informationPass by Reference vs. Pass by Value
Pass by Reference vs. Pass by Value Most methods are passed arguments when they are called. An argument may be a constant or a varable. For example, n the expresson Math.sqrt(33) the constant 33 s passed
More informationLobachevsky State University of Nizhni Novgorod. Polyhedron. Quick Start Guide
Lobachevsky State Unversty of Nzhn Novgorod Polyhedron Quck Start Gude Nzhn Novgorod 2016 Contents Specfcaton of Polyhedron software... 3 Theoretcal background... 4 1. Interface of Polyhedron... 6 1.1.
More informationAssembler. Shimon Schocken. Spring Elements of Computing Systems 1 Assembler (Ch. 6) Compiler. abstract interface.
IDC Herzlya Shmon Schocken Assembler Shmon Schocken Sprng 2005 Elements of Computng Systems 1 Assembler (Ch. 6) Where we are at: Human Thought Abstract desgn Chapters 9, 12 abstract nterface H.L. Language
More informationThis chapter discusses aspects of heat conduction. The equilibrium heat conduction on a rod. In this chapter, Arrays will be discussed.
1 Heat Flow n a Rod Ths chapter dscusses aspects of heat conducton. The equlbrum heat conducton on a rod. In ths chapter, Arrays wll be dscussed. Arrays provde a mechansm for declarng and accessng several
More informationA fault tree analysis strategy using binary decision diagrams
Loughborough Unversty Insttutonal Repostory A fault tree analyss strategy usng bnary decson dagrams Ths tem was submtted to Loughborough Unversty's Insttutonal Repostory by the/an author. Addtonal Informaton:
More informationAdaptive Load Shedding for Windowed Stream Joins
Adaptve Load Sheddng for Wndowed Stream Jons Bu gra Gedk College of Computng, GaTech bgedk@cc.gatech.edu Kun-Lung Wu, Phlp Yu T.J. Watson Research, IBM {klwu,psyu}@us.bm.com Lng Lu College of Computng,
More informationOutline. CIS 110: Introduction to Computer Programming. Review: Interactive Sum. More Cumulative Algorithms. Interactive Sum Trace (2)
Outlne CIS 110: Introducton to Computer Programmng More on Cumulatve Algorthms Processng Text Tacklng Programmng Problems Lecture 11 Text Processng and More On Desgn ( 4.2-4.3) 10/17/2011 CIS 110 (11fa)
More informationAMath 483/583 Lecture 21 May 13, Notes: Notes: Jacobi iteration. Notes: Jacobi with OpenMP coarse grain
AMath 483/583 Lecture 21 May 13, 2011 Today: OpenMP and MPI versons of Jacob teraton Gauss-Sedel and SOR teratve methods Next week: More MPI Debuggng and totalvew GPU computng Read: Class notes and references
More informationCHAPTER 10: ALGORITHM DESIGN TECHNIQUES
CHAPTER 10: ALGORITHM DESIGN TECHNIQUES So far, we have been concerned wth the effcent mplementaton of algorthms. We have seen that when an algorthm s gven, the actual data structures need not be specfed.
More information2D Raster Graphics. Integer grid Sequential (left-right, top-down) scan. Computer Graphics
2D Graphcs 2D Raster Graphcs Integer grd Sequental (left-rght, top-down scan j Lne drawng A ver mportant operaton used frequentl, block dagrams, bar charts, engneerng drawng, archtecture plans, etc. curves
More informationOracle Database: SQL and PL/SQL Fundamentals Certification Course
Oracle Database: SQL and PL/SQL Fundamentals Certfcaton Course 1 Duraton: 5 Days (30 hours) What you wll learn: Ths Oracle Database: SQL and PL/SQL Fundamentals tranng delvers the fundamentals of SQL and
More informationVirtual Memory. Background. No. 10. Virtual Memory: concept. Logical Memory Space (review) Demand Paging(1) Virtual Memory
Background EECS. Operatng System Fundamentals No. Vrtual Memory Prof. Hu Jang Department of Electrcal Engneerng and Computer Scence, York Unversty Memory-management methods normally requres the entre process
More informationSupport Vector Machines. CS534 - Machine Learning
Support Vector Machnes CS534 - Machne Learnng Perceptron Revsted: Lnear Separators Bnar classfcaton can be veed as the task of separatng classes n feature space: b > 0 b 0 b < 0 f() sgn( b) Lnear Separators
More informationTECHNIQUE OF FORMATION HOMOGENEOUS SAMPLE SAME OBJECTS. Muradaliyev A.Z.
TECHNIQUE OF FORMATION HOMOGENEOUS SAMPLE SAME OBJECTS Muradalyev AZ Azerbajan Scentfc-Research and Desgn-Prospectng Insttute of Energetc AZ1012, Ave HZardab-94 E-mal:aydn_murad@yahoocom Importance of
More informationCHAPTER 2 DECOMPOSITION OF GRAPHS
CHAPTER DECOMPOSITION OF GRAPHS. INTRODUCTION A graph H s called a Supersubdvson of a graph G f H s obtaned from G by replacng every edge uv of G by a bpartte graph,m (m may vary for each edge by dentfyng
More informationTF 2 P-growth: An Efficient Algorithm for Mining Frequent Patterns without any Thresholds
TF 2 P-growth: An Effcent Algorthm for Mnng Frequent Patterns wthout any Thresholds Yu HIRATE, Ego IWAHASHI, and Hayato YAMANA Graduate School of Scence and Engneerng, Waseda Unversty {hrate, ego, yamana}@yama.nfo.waseda.ac.jp
More informationMODELING THE RELIABILITY OF INFORMATION MANAGEMENT SYSTEMS BASED ON MISSION SPECIFIC TOOLS SET SOFTWARE
Knowledge Dynamcs MODELING THE ELIABILITY OF INFOMATION MANAGEMENT SYSTEMS BASED ON MISSION SPECIFIC TOOLS SET SOFTWAE Cezar VASILESCU Assocate Professor, egonal Department of Defense esources Management
More informationAn Object Detection Method based on the Separability Measure using an Optimization Approach
An Object Detecton Method based on the Separablt Measure usng an Optmzaton Approach Edward Y. H. Cho *, Wa Tak Hung 2 Hong Kong Poltechnc Unverst, Hung Hom, Kowloon, Hong Kong E-mal: mahcho@net.polu.edu.hk
More informationSmoothing Spline ANOVA for variable screening
Smoothng Splne ANOVA for varable screenng a useful tool for metamodels tranng and mult-objectve optmzaton L. Rcco, E. Rgon, A. Turco Outlne RSM Introducton Possble couplng Test case MOO MOO wth Game Theory
More informationAlufix Expert D Design Software #85344
238 ALUFIX SOFTWARE Alufx Expert 2014 3D Desgn Software #85344 Alufx Expert software makes automatc desgns for fxtures wth correspondng partlsts. You choose the system and defne clampng ponts. The software
More informationRelated-Mode Attacks on CTR Encryption Mode
Internatonal Journal of Network Securty, Vol.4, No.3, PP.282 287, May 2007 282 Related-Mode Attacks on CTR Encrypton Mode Dayn Wang, Dongda Ln, and Wenlng Wu (Correspondng author: Dayn Wang) Key Laboratory
More information