73 Pages

pq.4up

Course: CS 226, Fall 2009
School: Princeton
Rating:
 
 
 
 
 

Word Count: 1843

Document Preview

226 COS Lecture 5: Priority Queues Abstract data types client interface implementation Priority queue ADT insert remove the largest HEAPS and Heapsort ADTs and algorithms PERFORMANCE MATTERS ADT allows us to substitute better algorithms without changing any client code Running time depends on implementation client usage Might need different implementations for different clients GOALS general-purpose ADT useful...

Register Now

Unformatted Document Excerpt

Coursehero >> New Jersey >> Princeton >> CS 226

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.
226 COS Lecture 5: Priority Queues Abstract data types client interface implementation Priority queue ADT insert remove the largest HEAPS and Heapsort ADTs and algorithms PERFORMANCE MATTERS ADT allows us to substitute better algorithms without changing any client code Running time depends on implementation client usage Might need different implementations for different clients GOALS general-purpose ADT useful for many clients efficient implementation of all ADT functions ADTs provide levels of abstraction allowing us to build algorithms for increasingly complicated problems Ex: linked list -> stack -> quicksort BINOMIAL QUEUES 5.1 5.3 Abstract data types Separate INTERFACE and IMPLEMENTATION easier maintainence of large programs build layers of abstraction reuse software elementary example: pushdown stack INTERFACE: description of data type, basic operations CLIENT: program using operations defined in interface IMPLEMENTATION: actual code implementing operations Client can't know details of implementation (many implementations to choose from) Implementation can't know details of client needs (many clients use the same implementation) Modern programming languages support ADTs C++, Modula-3, Oberon, Java (C) 5.2 Priority queue ADT Records with keys (priorities) Two basic operations INSERT DELETE LARGEST generic operations common to many ADTs create test if empty destroy (often ignored if not harmful) Example applications simulation numerical computation compression algorithms graph-searching algorithms 5.4 Priority queue interface INTERFACE for basic operations . . . . void PQinit(); void PQinsert(Item); Item PQdelmax(); int PQempty(); Unordered-array PQ implementation static Item *pq; static int N; PQinsert(Item v) { pq[N++] = v; } Item PQdelmax() { int j, max = 0; for (j = 1; j < N; j++) if (less(pq[max], pq[j])) max = j; exch(pq[max], pq[N]); return pq[--N]; } void PQinit(int maxN) { pq = malloc(maxN*sizeof(Item)); N = 0; } int PQempty() { return N == 0; } 5.5 5.7 Should also specify constraints and error conditions Other useful operations delete a specified item change an item's priority merge together two PQs (stay tuned) Sample PQ client Find the M SMALLEST of N items (typical vals: M=100, N=1000000) PQinit(); for (k = 0; k < M; k++) PQinsert(nextItem()); for (k = M; k < N; k++) { PQinsert(nextItem()); t = PQdelmax(); } for (k = 0; k < M; k++) a[k] = PQdelmax(()); Other PQ implementations Elementary ordered array unordered linked list ordered linked list Advanced heap binomial queue Time bounds for standard implementations: space proportional to M brute-force: N M best: N lg M best offline: N (with select, see lecture 3) 5.6 5.8 Client/Interface/Implementation INTERFACE define data types declare functions in C, use ".h" file (no executable code) CLIENT: include ".h" file call functions IMPLEMENTATION: include ".h" file give code for functions Client and implementation can be compiled at different times, then function calls LINKED to their implementations Details: Sedgewick, Chapter 4; COS 217 Modular programming 5.9 First-class PQ ADT . . . . . . . . . typedef struct pq* PQ; typedef struct PQnode* PQlink; PQ PQinit(); int PQempty(PQ); PQlink PQinsert(PQ, Item); Item PQdelmax(PQ); void PQchange(PQ, PQlink, Item); void PQdelete(PQ, PQlink); PQ PQjoin(PQ, PQ); PQ and PQlink are pointers to structures to be specified in the implementation More info: section 4.8 in Sedgewick; lecture 7 5.11 Priority queue ADT (continued) Other useful operations construct a PQ from N items return the value of the largest delete a specified item change an item's priority merge together two PQs Interface more complicated need HANDLES for records need HANDLES for priority queues where's the data? (client, implementation, or both?) PQ implementations cost summary Worst-case per-operation time as a function of PQ size . . ordered array list unordered array list heap binomial queue best in 5.10 insert N N 1 1 delete find change max delete max key 1 1 N N lg N lg N N 1 1 1 lg N lg N 1 1 N N 1 lg N N N 1 1 lg N lg N join N N N 1 N lg N lg N lg N theory 1 lg N lg N 1 1 1 5.12 PQ data structures HEAP lg N for all operations BINOMIAL QUEUE lg N for all operations constant (amortized) for most basis for near-optimal slgs Algorithm design success story: nearly optimal worst-case cost simple (but ingenious!) algorithms costs even lower in practice Heap Array representation of heap-ordered binary tree root in a[1] children of 1 in a[2] and a[3] children of i in a[2i] and a[2i+1] parent of i in a[i/2] No explicit links needed for tree . . 0 1 X 2 T 3 O 4 G 5 S 6 M 7 N 8 A 9 10 11 12 E R A I 5.13 5.15 Heap-ordered complete binary trees COMPLETE BINARY TREE: leaves on two levels, on left at bottom level HEAP-ORDERED: parent larger than both children therefore, largest at root can define for any tree, not just complete 1 2 4 8 Promotion (bubbling up in a heap) Change key in node at the bottom the of heap To restore heap condition: exchange with parent if necessary X S P R E O A I M N X 3 G T 5 O 7 A T G 9 S 11 6 M N X A E 10 R A 12 I T G A 5.14 P S E O A I M N R 5.16 Promotion implementation Peter principle nodes rise to level of incompentence Node k's parent in heap is k/2 fixUp(Item a[], int k) { while (k > 1 && less(a[k/2], a[k])) { exch(a[k], a[k/2]); k = k/2; } } Demotion implementation "Power struggle" principle better subordinate is promoted Node k's children in heap are 2k and 2k+1 fixDown(Item a[], int k, int N) { int j; while (2*k <= N) { j = 2*k; if (j < N && less(a[j], a[j+1])) j++; if (!less(a[k], a[j])) break; exch(a[k], a[j]); k = j; } } 5.17 5.19 Demotion (sifting down in a heap) Change key in node at the top of the heap To restore heap condition: exchange with larger child if necessary PQ implementation with heaps PQinsert: add node at bottom, bubble up PQdelmax: exch root with node at bottom, sift down static Item pq[maxPQsize+1]; static int N; void PQinit(int maxN) O T G A E R S A I P M X N { pq = malloc(maxN*sizeof(Item)); N = 0; } int PQempty() { return N == 0; } void PQinsert(Item v) { pq[++N] = v; fixUp(pq, N); } X T G A E R S A I P O M N Item PQdelmax() { exch(pq[1], pq[N]); fixDown(pq, 1, N-1); return pq[N--]; 5.18 } 5.20 Constructing a heap (top-down) Heapsort Abandon ADT concept to save space Faster to construct heap backwards #define pq(A) a[l-1+A] T A A S R O I S S T O R I void heapsort(Item a[], int l, int r) N A A { int k, N = r-l+1; for (k = N/2; k >= 1; k--) fixDown(&pq(0), k, N); T S A S O R I N O G A while (N > 1) { exch(pq(1), pq(N)); S T O A S G R I O N R A fixDown(&pq(0), 1, --N); } } E X T S A O T G A E O S R I N R Widely used sorting method inplace, guaranteed NlgN time 5.23 Sorting down a heap X T G A E R S A I O M L P N E A G E E M L I Bottom-up heap construction G O N A A E A E A S O T E X A M P I L S A O T E X A M S N I L E G R E A O S N I L E G A O X E T A M P I L N E T S G A E E P M N M L A G E L N I E A O E A A G R A I E R N E G R P X T A M P R S R G A P M L N M A G I O E A L E E A I E E A A S A A X P X P T N I L E G R E A S A M O I L P N E P X X N R E G E T N R E G E R M G A E E L A I O P N L G A E E I A A A G R E T O A M I L T S A M O I L S A A M O P M G A E E L A I O I N A G E E A A 5.22 5.24 Binomial queues Support ALL PQ operations in lgN steps Heaps have slow merge Def: In a LEFT HEAP-ORDERED tree, each node is larger than all nodes in left subtree Def: A POWER-OF-2 TREE is a binary tree left subtree of root complete right subtree empty (therefore, 2^n nodes) Def: A BINOMIAL QUEUE of size N is of left heap-ordered power-of-2 trees one for each 1 bit in binary rep. of N 5.25 Joining power-of-2 heaps Constant-time operation larger of two roots at top left subtree to right subtree of other root result is left-heap-ordered if inputs a...

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:

Princeton - COS - 226
Abstract data types (ADTs)Separate interface and implementation so as toPriority QueuesPriority Queue ADT Heaps and Heapsort Binomial Queues build layers of abstraction reuse softwareEx: pushdown stack, FIFO queue interface: description of d
Princeton - COS - 435
Crawling the Web1Web CrawlingRetrieve (for indexing, storage, .) Web pages by using the links found on a page to locate more pages.Must have some starting point21Type of crawl Web crawl versuscrawl of more limited network web cs.princ
Princeton - COS - 423
COS 423: Theory of AlgorithmsSpring 2007Lecture 4 February 14, 2007Prof. Robert Tarjan Scribe: Wolfgang Mulzer1OverviewIn this lecture, we are going to nish the description of splay trees and start with priority queues.2Amortized Anal
Princeton - COS - 435
Clustering Algorithms: Hierarchical and variations1General agglomerative Uses any computable cluster similarity measure sim(Ci, Cj) For n objects v1, ., vn, assign each to a singleton cluster Ci = {vi}. repeat { identify two most similar clus
Princeton - COS - 423
Heaps SimpliedBernhard Haeupler2 , Siddhartha Sen1,4 , and Robert E. Tarjan1,3,41Princeton University, Princeton NJ 08544, {sssix, ret}@cs.princeton.edu 2 CSAIL, Massachusetts Institute of Technology, haeupler@mit.edu 3 HP Laboratories, Palo Alto
Princeton - PHYS - 102
Physics 102, Learning Guide 4, Spring 20021Learning Guide 4zB=0.2 T y a x1. Magnetic FluxR=1 bA coil of wire with resistance R = 1 and sides of length a = 0.2 m and b = 0.5 m lies in a plane perpendicular to a magnetic eld of strength B
Midwestern State University - EB - 1955
EB1955Wine Grape Establishment and Production Costs in Washington, 2003ByTrent Ball &amp; Raymond J. FolwellWine Grape Establishment and Production Costs in Washington, 2003By Trent Ball &amp; Raymond J. Folwell*IntroductionThe Washington wine gra
Midwestern State University - EB - 1349
EB1349insect answersGREENHOUSE WHITEFLY: BIOLOGY AND CONTROLThe Greenhouse Whitefly, Trialeurodes vaporariorum, causes serious problems in greenhouses, home gardens, and cultivated crops. These pests are most frequently encountered in greenhouse
LSU - APPL - 003
Transcript t for &quot;Cons struction In nterviewin ng Day: Re esearch&quot; V Video (Professio onals' advice a about Constru uction Intervi iewing Day) Lopez: Personally, what I'm loo oking for is somebody to co ome in and kn now the company. Do the
Princeton - CS - 333
Overview Generic programming The traditional view of algorithms and data structures ties them closely together It doesn' have to be that way tespecially not for simple algorithms. which turn out to be useful in surprisingly many contextsHow to w
Princeton - CS - 333
Generic programmingHow to write programs that don' t quite know what they' doing reOverview The traditional view of algorithms and data structures ties them closely together It doesn' have to be that way tespecially not for simple algorithms.
Minnesota - EC - 5113
Andrew McLennanJanuary 26, 1999Economics 5113 Introduction to Mathematical Economics Winter 1999Maximization of Univariate FunctionsI. Introduction A. In this lecture we consider the application of the basic results concerning optimization to
Midwestern State University - CPTS - 559
Cellular IP: A New Approach to Internet Host MobilityAndrs G. Valk1 Ericsson Research andras.valko@lt.eth.ericsson.seAbstract This paper describes a new approach to Internet host mobility. We argue that by separating local and wide area mobility,
Minnesota - CE - 4501
CE 4501 HYDROLOGIC DESIGNProject # 4, Fall 2003 Unit Hydrograph Part 1 The following is a hydrograph observed at a bridge site due to a storm of 4-hour duration over a 20 km2 watershed. Time (hr) 0 4 8 12 16 20 24 Discharge (m3/s) 5 15 35 25 15 10 5
Princeton - COS - 435
COS 435, Spring 2009 Graphs for Problem Set 3, Problem 1 Input for your programs. We are providing a simple text file for each graph. The first line of the file contains the number of nodes. Each successive line lists one edge by listing the node at
Princeton - COS - 126
COS 126General Computer ScienceSpring 2003Midterm 1This test has 9 questions worth a total of 50 points. You have 120 minutes. The exam is closed book, except that you are allowed to use a one page cheatsheet. No calculators or other electron
Princeton - COS - 126
COS 126General Computer ScienceSpring 2003Midterm 1This test has 9 questions worth a total of 50 points. You have 120 minutes. The exam is closed book, except that you are allowed to use a one page cheatsheet. No calculators or other electron
Princeton - COS - 116
COS 116 The Computational Universe Laboratory 8: Digital Logic IIIn this lab youll learn that, using only AND, OR, and NOT gates, you can build a circuit that can add two numbers. If you get stuck at any point, feel free to discuss the problem with
Princeton - CS - 126
Introduction to Theoretical CSLecture T1: Pattern MatchingTwo fundamental questions.sWhat can a computer do? What can a computer do with limited resources?sGeneral approach.sDont talk about specific machines or problems. Consider minima
Princeton - CS - 226
Data CompressionData CompressionCompression reduces the size of a file:nTo save TIME when transmitting it. To save SPACE when storing it. Most files have lots of redundancy.nnWho needs compression? Some of these lecture slides have been
Princeton - CS - 126
ArchitectureLecture A4: Sequential CircuitsLecture A1 A2: TOY machine. Lecture A3: Boolean logic and combinational circuits.sIn principle, we could build TOY computer with one gigantic combinational circuit. ! 256 16 = 4,096 inputs 24096 ro
Minnesota - ZIEF - 0002
EPsy 8261 Statistical Methods I: Probability and Inference Lab #5 15 pts.STATISTICAL POWERThe CLA.csv dataset consists of many different admissions variables for a simple random sample of 400 College of Liberal Arts (CLA) students from the Univers
Minnesota - MATH - 1372
MATH 1372 HW11 answers11.7 #2, 4, 10, 24, 26, 28 2. converges (root test) 4. converges (alternating series test) 10. converges (integral test) 24. diverges (terms do not go to 0) 26. converges (ratio test) 28. converges (compare with e/n2 ) 11.8 #4
Minnesota - MATH - 1372
MATH 1372 Worksheet answers Tuesday, November 11, 2008Section 11.4: The comparison tests 1/n2 ) 1/n)1. converges (compare with2. diverges (limit comparison test with 3. converges (compare with 4. converges (compare with 1/n3/2 ) (2/3)n ) 15.
Princeton - PHYS - 301
Physics 301 Reading8-Nov-2004 20-1K&amp;K chapter 9 and start on chapter 10. Also, some of the material we'll be discussing this week is taken from Mandl, chapter 11.Gibbs Free Energy As we discussed last time, the Gibbs free energy is obtained fro
Princeton - COS - 126
Fundamental QuestionsUniversality and ComputabilityQ. What is a general-purpose computer? Q. Are there limits on the power of digital computers? Q. Are there limits on the power of machines we can build?Pioneering work in the 1930s. Princeton =
Princeton - COS - 126
Fundamental QuestionsLecture 19: Universality and ComputabilityUniversality. What is a general purpose computer? Computability. Are there problems that no machine can solve? Church-Turing thesis. Are there limits on the power of machines that we
Princeton - COS - 598
` F UA 9 F U D B F @ 9 9 n p F F B ` p Sp F F S G D R b R 9 8 F A C p a B B A 8 IA B 8 F U A P F @ 9 8 F @ H B U FR Y T I G E F B F @ 9 G I Q B 9 B A F B 8 I A 9 a R I B 9
LSU - ME - 3842
Problem # 11.7: A tank of volume V = 10m 3 contains compressed air at 15 0C. the gage pressure in the tank is 4.50 MPa. Evalute the work required to fill the tank by compressing air from standard atmosphere conditions for (a) isothermal compression a
Youngstown - M - 1571
+!+! &quot;&quot; +&quot; % !&quot;#$ &quot; #$ &quot; &quot; &quot; = &quot;#$&amp; &quot;#$ #$ +% + &quot; + % + ! = + &quot;% #$ # ' #( ! ( ' + &quot; &quot; &quot;$'#( !/&amp; ! + &quot;&quot;' #(&quot; &quot;&quot; + &quot; &quot;)(&amp;!( % % + &quot;+&quot; &amp;
Youngstown - M - 1548
Orestart:with( plots):with (student):with(Student[Calculus1]):Section I ex 1 O g(x):= x^2 + 7*x -8; Roots( x^2 - 7*x-8, x ); g x := x2 C7 x K8 K 8 1, ex 2 O g(x):= 2*x^2 + 3*x + 1; Roots(2*x^2 + 3*x + 1,x); 2 g x := 2 x C3 x C1 1 K K 1, 2 ex 3 O
Youngstown - M - 1572
MATH 1572Sample EXAMINATION IJuly 15, 2005I. Dierentiate each of the following: 1. ln(sec(x) 2. sin1 (1 + sin(x)1 3. tan1 ( x2 )4. e1+x25. What is the domain of sin1 (ln((x) and than dierentiate it?6. If f (x) = xk ex where k is a p
Youngstown - M - 3751
Math. 3751 Assignment 1 Jan 18,2005. This problem set is to review some ideas from the Discrete Math. course Some review formulas are: (p q) (p q) ( Please prove it by truth tables) ( x W ) ( x W ) ( x W ) ( x W ) It is importtant to realize t
Youngstown - M - 2673
&gt; restart:with(student): with(plots):# solutions hw P 11127 in reverse orderWarning, the name changecoords has been redefined&gt; #61 &gt; A1:= plot3d(2,theta=0.2*Pi,phi=0.Pi/2, coords=spherical,color=blue, style=patch,axes = boxed): &gt; A2:= plot3d(1,the
Youngstown - M - 3720
! &quot; !#&quot;#$ %&amp;#$ '&amp; +#%( )) ( = ) ) ) ) ) ) ) )$!%&amp; $ '&amp; !(&amp;#) &amp; ) ) ) ) ) &amp;( ) ) + ) ) ) ) ) ) # (! &quot;* ! &quot;!#$ %&amp;#$ ''( + ) ) ##(*+*#, #$ %&amp;#$ ',&amp;* -(* .#/ 0/ 0!#(
Youngstown - M - 2673
&gt; restart:with(plots):with(linalg);Warning, the name changecoords has been redefined Warning, the protected names norm and trace have been redefined and unprotected[ BlockDiagonal, GramSchmidt, JordanBlock, LUdecomp, QRdecomp, Wronskian, addcol, a
Youngstown - M - 2673
&gt; restart:with(student): with(plots):# solutions to exam 3Warning, the name changecoords has been redefined&gt; #1 &gt; plot3d(4-x-2*y,x=0.4, y=0 . 6,style=patch,axes = boxed);&gt; Int(Int(Int(1, z=0.4-x-2*y),y=0 .(4-x)/2), x=0.4) = int(int(int(1, z=0.4-
Youngstown - ENGR - 6923
Youngstown State University College of Engineering &amp; TechnologyCivil &amp; Environmental/Chemical Engineering Program ENGR6923: Information Technology Tools for Engineers (3 s.h.) Course Outline Spring, 2004Instructor: Dr. Javed Alam Spring Semester 2
Minnesota - ZIMM - 0230
Name_Math 1296 Instr: Laura Zimmermann Exam 2 Review Problems The exam covers sec 2.8, 3.1-3.10. This includes all material from class, homework, and quizzes. Please answer all questions carefully. Use proper notation and show all of your work. 1.
Minnesota - SJOB - 0015
Youngstown - CHEM - 1506
Chemistry 1506Dr. Hunters ClassSection 1 Notes - Page 1/32Chemistry 1506: Allied Health Chemistry 2Section 1: Structure and Bonding in Alkanes Basics of Structure and BondingOutlineSECTION SECTION SECTION SECTION SECTION SECTION SECTION SE
Youngstown - CHEM - 1506
Chemistry 1506Dr. Hunters ClassSection 2 Notes - Page 1/29Chemistry 1506: Allied Health Chemistry 2Section 2: Alkenes, Alkynes, and Aromatic Compounds Hydrocarbons with Multiple BondsOutlineSECTION SECTION SECTION SECTION SECTION SECTION
Youngstown - CHEM - 1506
Chemistry 1506Dr. Hunters ClassSection 9 Notes - Page 1/25Chemistry 1506: Allied Health Chemistry 2Section 9: Proteins Biochemical AmidesOutlineSECTION SECTION SECTION SECTION SECTION SECTION9.1 PROTEIN ROLES..2 9.2 AMINO ACIDS.4 9.3 PE
Youngstown - CHEM - 506
Chemistry 506Dr. Hunter's ClassChapter 11.1Chemistry 506: Allied Health Chemistry 2 Chapter 11: Alkenes, Alkynes, and Aromatic Compounds Hydrocarbons with Multiple BondsIntroduction to General, Organic &amp; Biochemistry, 5th Edition by Bettelhei
Youngstown - CHEM - 506
Chemistry 506Dr. Hunter's ClassChapter 10. .1Chemistry 506: Allied Health Chemistry 2 Chapter 10, Structure and Bonding in Alkanes Basics of Structure and BondingIntroduction to General, Organic &amp; Biochemistry, 5th Edition by Bettelheim and
Maryland - PHYS - 270
PHYS 270 SUPPL. #19DENNIS PAPADOPOULOS MARCH 25, 2009h2 = s+dh2 2ss /c + s' /v = const s + ns'= const.Take rays near axis, paraxial rays The excess time along OP is h2/2s and the excess time on the PO' route is n(h2/2s'). This is compensated
Princeton - CS - 126
Mathematical InductionLecture P7: Advanced RecursionMathematical induction.sPowerful and general proof technique in discrete mathematics. To prove a theorem true for all integers N 0: Base case: Prove it to be true for N = 0. Induction step
Princeton - COS - 226
Mergesort and QuicksortLecture 3: Efficient SortsTwo great sorting algorithms.nFull scientific understanding of their properties has enabled us to hammer them into practical system sorts. Occupies a prominent place in world's computational inf
LSU - E - 003
LSU - E - 003
LSU - E - 003
LSU - E - 003
LSU - E - 003
LSU - E - 003
Youngstown - CHEM - 824
Department of Chemistry Chemistry 824 FINAL EXAM1Friday, Dec. 9, 1994, 8 a.m.Name:_ Last First Answer 8 of the following Questions: 1. 2. (5 points) For the following pair of polymers, predict their relative glass transition temperature (Tg). G
Youngstown - CHEM - 824
Chemistry 824 Final Exam, Fall 1998 Name:_ This exam is worth a total of 100 points. Each question is worth 20 points. There are a total of 6 questions. Answer 5 of these. Clearly indicate which five you want me to grade! In you explanations use text
Minnesota - MATH - 5378
Math 5378, Differential Geometry Homework 8 Due in-class on Wednesday, April 2 Numbered exercises are from Do Carmo, Differential Geometry of Curves and Surfaces. 1. Section 3.3, number 5. 2. Section 3.3, number 11. 3. Section 3.3, number 20. 4. Sect
Minnesota - MATH - 5378
Math 5378, Differential Geometry Homework 9 Due in-class on Wednesday, April 9 Numbered exercises are from Do Carmo, Differential Geometry of Curves and Surfaces. 1. Section 4.2, number 1. 2. Section 4.2, number 2. 3. Section 4.2, number 11. 4. Secti
Princeton - PHYS - 102
Nuclear Physics and RadioactivityPhysics 102 25 April 2002 Lecture 10Wilhelm Roentgen X-raysMarie &amp; Pierrre Curie RadioactivityErnest Rutherford NucleusJames Chadwick NeutronFrom: http:/www.th.physik.uni-frankfurt.de/~jr/portraits.html 25
Princeton - PHY - 301
Physics 301 Reading Finish K&amp;K chapter 13, K&amp;K chapter 14.5-Dec-2005 28-1The Depletion Region in a p-n Junction The figure is a schematic of our view of a p-n junction up to this point. The n-type material is on the left and the p-type is on the