×
Log in to StudySoup
Get Full Access to Introduction To Algorithms - 3 Edition - Chapter 21 - Problem 21-1
Join StudySoup for FREE
Get Full Access to Introduction To Algorithms - 3 Edition - Chapter 21 - Problem 21-1

Already have an account? Login here
×
Reset your password

Off-line minimum The off-line minimum problem asks us to

Introduction to Algorithms | 3rd Edition | ISBN: 9780262033848 | Authors: Thomas H. Cormen ISBN: 9780262033848 130

Solution for problem 21-1 Chapter 21

Introduction to Algorithms | 3rd Edition

  • Textbook Solutions
  • 2901 Step-by-step solutions solved by professors and subject experts
  • Get 24/7 help from StudySoup virtual teaching assistants
Introduction to Algorithms | 3rd Edition | ISBN: 9780262033848 | Authors: Thomas H. Cormen

Introduction to Algorithms | 3rd Edition

4 5 1 236 Reviews
18
3
Problem 21-1

Off-line minimum The off-line minimum problem asks us to maintain a dynamic set T of elements from the domain f1; 2; : : : ; ng under the operations INSERT and EXTRACT-MIN. We are given a sequence S of n INSERT and m EXTRACT-MIN calls, where each key in f1; 2; : : : ; ng is inserted exactly once. We wish to determine which key is returned by each EXTRACT-MIN call. Specifically, we wish to fill in an array extracted1 : : m, where for i D 1; 2; : : : ; m, extractedi is the key returned by the ith EXTRACT-MIN call. The problem is off-line in the sense that we are allowed to process the entire sequence S before determining any of the returned keys. a. In the following instance of the off-line minimum problem, each operation INSERT.i / is represented by the value of i and each EXTRACT-MIN is represented by the letter E: 4; 8; E; 3; E; 9; 2; 6; E; E; E; 1; 7; E;5: Fill in the correct values in the extracted array. To develop an algorithm for this problem, we break the sequence S into homogeneous subsequences. That is, we represent S by I1; E;I2; E;I3;:::;Im; E;ImC1 ; where each E represents a single EXTRACT-MIN call and each Ij represents a (possibly empty) sequence of INSERT calls. For each subsequence Ij , we initially place the keys inserted by these operations into a set Kj , which is empty if Ij is empty. We then do the following: OFF-LINE-MINIMUM.m; n/ 1 for i D 1 to n 2 determine j such that i 2 Kj 3 if j m C 1 4 extractedj D i 5 let l be the smallest value greater than j for which set Kl exists 6 Kl D Kj [ Kl, destroying Kj 7 return extracted b. Argue that the array extracted returned by OFF-LINE-MINIMUM is correct. c. Describe how to implement OFF-LINE-MINIMUM efficiently with a disjointset data structure. Give a tight bound on the worst-case running time of your implementation.

Step-by-Step Solution:
Step 1 of 3

Chapter 13 – Respiratory Physiology Organization of the Respiratory System – Inspiration is the movement of air from the external environment through the airways into the alveoli during breathing. Expiration is the movement of air in the opposite direction. An inspiration and expiration constitute the respiratory cycle. The alveoli are tiny air­containing sacs which are the sites of gas exchange with the blood. The airways are the tubes that air flows through from the external environment to the alveoli and back. The Airways and Blood Vessels – The pharynx is a passage common to both air and food. The pharynx branches into the esophagus and larynx. The larynx is part of the airways and houses the vocal cords. The larynx opens into the trachea, which branches into 2 bronchi. Each bronchus enters one lung. The bronchi continue branching in the lung until they become cartilage­less bronchioles, terminal bronchioles, and eventually respiratory bronchioles (in which alveoli first start to appear). The airways end in grapelike clusters called alveolar sacs that consist entirely of alveoli. The airways beyond the larynx can be divided into two zones. 1. Conducting Zone – extends from the top of the trachea to the beginning of the respiratory bronchioles 2. Respiratory Zone – extends from the respiratory bronchioles down to the alveoli. Site of Gas Exchange: The Alveoli – The alveoli are tiny sacs whose open ends are continuous with the lumens of the airways. Most of the air­facing surfaces of the wall are lined by a continuous layer, one cell thick, of flat epithelial cells called type­1 alveolar cells. Interspersed between these cells are thicker, specialized cells termed type II alveolar cells that produce a surfactant. In between the alveoli is connective tissue and small amount of interstitial fluid. Often times, however, the basement membrane of the type­1 alveolar cells and the capillary­wall endothelium fuse. In some of the alveolar wall, pores permit the flow of air between alveoli. Relation of the Lungs to the Thoracic Wall – The lungs and the heart are situated in the thorax, the compartment of the body between the neck and abdomen. The thorax is a closed compartment bounded at the neck by muscles and connective tissue and separated from the abdomen by the diaphragm. The wall is made up of intercostal muscles that reside between the ribs. Each lung is surrounded by a closed sac called the pleural sac, consisting of a thin sheet of cells called the pleura. The pleura are a 2­membrane structure. The visceral pleura is actually attached to the lung via connective tissue. The outer layer is called the parietal pleura and is attached to interior thoracic wall. These 2 membranes are separated by a thin layer of intrapleural fluid. Intrapleural pressure is the hydrostatic pressure of the intrapleural fluid and causes the lungs and thoracic wall to move in and out together during normal breathing. Ventilation and Lung Mechanics – Ventilation is defined as the exchange of air between the atmosphere and alveoli. Like blood, air moves by bulk flow from a region of high pressure to one of low pressure. Bulk flow can be described by the equation: F=∆ P/R. For airflow into or out of the lungs to occur, the relevant pressures are alveolar pressure and the atmospheric pressure. A change in lung dimensions causes a change in alveolar pressure and can be described P 1 =1 V .2 2 by Boyle’s Law at constant temperature: Pressure Measurements – There are no muscles attached to the lung surface to pull the lungs open or to push them shut. The lungs are passive, elastic structures whose volume depends on 2 factors. 1. Transpulmonary Pressure – this is a specific case of transmural pressure, defined as the pressure across a wall. This is the difference in pressure between the inside and outside of the lungs (the difference between alveolar pressure and intrapleural pressure). Alveolar pressure is always 4 mmHg greater than intrapleural pressure. If these 2 values were ever the same, the lungs would collapse. 2. Lung Stretching – this determines how much the lungs expand for a given change in Transpulmonary pressure. Pressure Summary – Air flow in an out of the lungs in measured by the difference in alveolar pressure and atmospheric pressure. The mechanism that keeps the lungs from collapsing and maintaining dimensions is the transpulmonary pressure, described as the difference between alveolar pressure and intrapleural pressure. Mechanism of Stable Balance between Breaths – When no air is flowing in either direction, atmospheric pressure is equal to alveolar pressure. Because the lungs always have air in them, the transmural (transpulmonary) pressure of the lungs must always be positive, so alveolar pressure is always greater than intrapleural pressure. At rest, when there is no airflow, alveolar pressure equals 0. This means intrapleural pressure must be negative for the lungs to remain open. Elastic recoil is responsible for causing intrapleural pressure to be negative. Elastic recoil is defined as the tendency of an elastic structure to oppose stretching or distortion. The natural tendency of the lungs is to collapse due to elastic recoil. The positive transpulmonary pressure opposes elastic recoil. At rest, all transmural pressures must balance each other out. But what is the reason for sub­atmospheric intrapleural pressure 1. Reason – the chest wall naturally wants to expand due to elastic recoil. Due to this same phenomenon, the lungs naturally want to collapse. As the 2 move farther apart, the intrapleural space between them enlarges. However, the fluid cannot expand the same way air can. The enlargement is so small that the pleural surfaces are still attached to one another, decreasing the pressure below atmospheric pressure. Inspiration – Inspiration is initiated by the contraction of the diaphragm and inspiratory intercostal muscles. The contraction of the diaphragm moves it down, expanding the thorax. As the thorax enlarges, the thoracic wall moves slightly farther away from the lung surface. This movement causes the intrapleural pressure to become more negative, increasing transpulmonary pressure. Transpulmonary pressure opposes elastic recoil, so the lungs expand. The lungs will expand until elastic recoil equals transpulmonary pressure. The expansion causes an increase in alveolar volume, so by Boyle’s Law, the alveolar pressure decreases to less than atmospheric pressure. This produces the difference in pressure that causes bulk flow of air into the lungs to reestablish equilibrium between atmospheric and alveolar pressure, and halt inflow at the end of inspiration. Expiration – The diaphragm and inspiratory intercostal muscles relax. The thorax decreases in volume. As the thorax decreases in volume, the thoracic wall moves slightly towards the lung surface. This movement causes the intrapleural pressure to become more positive, decreasing transpulmonary pressure. Therefore, the transpulmonary pressure acting to expand the lungs is now smaller than elastic recoil, so the lung volume gets smaller. As the lungs become smaller, air in the alveoli becomes compressed and pressure increases due to the lower volume. Therefore, bulk flow of air out of lungs reestablishes equilibrium between atmospheric and alveolar pressure, and halts outflow at the end of expiration. In addition, during exercise, expiratory intercostal muscles are responsible for actively decreases chest volume. Lung Compliance – The degree of lung expansion at any instant is proportional to the transpulmonary pressure. The ability to stretch is called compliance. Lung compliance is defined as the magnitude of the change in lung volume produced by a given change in the transpulmonary pressure. There are 2 main determinants of lung compliance: 1. Stretchability – This is the physical elastic properties of the connective tissues. A thickening of the lung tissues decreases lung compliance. 2. Surface Tension – The surface of alveolar cells is moist, so the alveoli can be pictured as air­filled sacs lined with water. The attractive forces between the water molecules is known as surface tension and it makes a water barrier that constantly tends to shrink and resists further stretching. Thus, the expansion of the lungs requires energy not only to stretch the connective tissue of the lung but also to overcome the surface tension of the water layer lining the alveoli. More Lung Compliance – Surface tension is so strong that it is necessary for type II alveoli cells to secrete a detergent­like substance called a surfactant. The surfactant reduces the cohesive forces between water molecules on the alveolar surface. Therefore, the surfactant lowers surface tension, increasing lung compliance. Respiratory Distress Syndrome – This is any disease characterized by surfactant deficiency. This is the leading cause of death of premature infants. Too little surfactant causes the alveoli to collapse. The elastic recoil is too much for the infant to handle with no surfactant to increase the transpulmonary pressure. Airway Resistance – As stated previously, the volume of air that flows in or out of the lungs per unit time is directly proportional to the pressure difference between alveolar and atmospheric pressure and inversely related to resistance. Therefore, the higher the resistance is, the smaller the airflow. The most important resistance factor is tube radii. Airway resistance is inversely proportional to the fourth power of the airway radii. There are multiple sources of resistance in the airways: 1. Transpulmonary Pressure – this exerts an outward force on the airways (and alveoli) in opposition to elastic recoil, and keeps the airways without cartilage from collapsing. Transpulmonary pressure increases during inspiration, causing the airway radii to increase in size. 2. Elastic Connective Tissue – this links the outside of the airways to the alveolar tissue. These fibers pill the airways open during inspiration. This is called lateral traction. Lateral traction acts in the same outward direction as transpulmonary pressure. a. During forced expiration, intrapleural pressure increases, forcing the airways to become smaller. If there is an high amount of resistance, there will be a limit as to how much a person can increase their intrapleural pressure during forced expiration. 3. Epinephrine – this hormone relaxes airway smooth muscle by an effect on beta­ adrenergic receptors. 4. Leukotrienes – contract respiratory smooth muscle Asthma – This is a disease characterized by intermittent episodes in which airway smooth muscle contracts strongly, increasing airway resistance. The basic defect is chronic inflammation in the airways which can be caused by allergies, viruses, or other environmental factors. 1. Anti­inflammatory drugs – aim is to reduce chronic inflammation and are mostly leukotriene inhibitors and reduce the hyperresponsiveness to factors 2. Bronchodilator drugs – aim is to overcome acute excessive airway smooth muscle contraction by relaxing the airways. One class of these drugs mimics the normal action of epinephrine on beta­adrenergic receptors. Chronic Obstructive Pulmonary Disease – This disease refers to emphysema, chronic bronchitis, or a combination of the two. Unlike asthma, increased smooth muscle contraction is not the cause. Emphysema is the destruction and collapse of the airways. Chronic bronchitis is characterized by excessive mucus production in the bronchi and chronic inflammatory changes in the small airways. Lung Volumes and Capacities – There are several lung volumes and capacities associated with inspiration and expiration that are listed on the following chart. Alveolar Ventilation – The total ventilation per minute is called minute ventilation and is equal to the tidal volume multiplied by the respiratory rate. The average person has a minute ventilation of about 6000 mL or 6L. Anatomical dead space is the space within the airways that do not exchange gas with the blood. An average tidal volume is 500 mL. However, the conducting airways have a volume of 150 mL, so each inhalation and exhalation actually only exchanges 350 mL of new air. Partial Pressures of Gases – Dalton’s Law says that the total pressure of a closed system (mixture) is the sum of individual partial pressures of gases, since each individual gas behaves as if no other gases are present. Diffusion of Gases in Liquids – Henry’s Law states that the amount of gas dissolved in a liquid will be directly proportional to the partial pressure of the gas with which the liquid is in equilibrium. Alveolar Gas Pressures – The partial pressure of oxygen is lower in the alveoli than in the atmosphere because some of the oxygen in the air entering the alveoli leaves them to enter the pulmonary capillaries. In addition, the partial pressure of carbon dioxide is higher in the alveoli than in the atmosphere because some of the carbon dioxide in the blood enters the alveoli in the pulmonary capillaries. There are several factors that determine the precise value of alveolar P : O2 1. Partial pressure of atmospheric oxygen 2. Rate of alveolar ventilation 3. Rate of total­body oxygen consumption Physiological Conditions – Hypoventilation exists when there is an increase in the ratio of carbon dioxide production to alveolar ventilation. In other words, a person is hypoventilating if the alveolar ventilation cannot keep pace with the carbon dioxide production. Therefore, the partial pressure of carbon dioxide in the body rises above normal value. Hyperventilation exists when there is a decrease in the ratio of carbon dioxide production to alveolar ventilation. In other words, a person is hyperventilating if alveolar ventilation is too great for the amount of carbon dioxide being produced. Gas Exchange between Alveoli and Blood – The blood that enters the pulmonary capillaries is systemic venous blood pumped to the lungs through the pulmonary arteries. It has a high P CO2 and a low P .O2he difference in partial pressures of oxygen and carbon dioxide on either side of the alveolar­capillary membrane result in a net diffusion. Therefore, the blood that leaves the pulmonary capillaries to return to the heart has the same P CO2 nd P O2s alveolar air. Matching of Ventilation and Blood Flow in Alveoli – The lungs are composed of 300 million alveoli. To be most efficient, the correct proportion of alveolar airflow (ventilation) and capillary blood flow (perfusion) should be available to each alveolus. A mismatch is called ventilation­ perfusion inequality. The major effect of an inequality is lower P of systemic arterial blood. To O2 compensate, decreased perfusion leads to decreased ventilation and decreased ventilation leads to decreased perfusion. This phenomenon can be seen on the picture on the following page. Transport of Oxygen in the Blood – Hemoglobin is a protein made up of 4 subunites bound together. Each subunit consists of a molecular group called a heme, and a polypeptide attached to the heme. The 4 polypeptides of a hemoglobin molecule are collectively called globin. Each of the 4 home groups contains one atom of iron which binds to molecular oxygen. Therefore, one hemoglobin can bind to 4 O . H2moglobin can either exist as deoxyhemoglobin (deoxygenated) or oxyhemoglobin (oxygenated). Effect of P O2 Hemoglobin Saturation – The experimentally determined quantitiative relationship between these 2 variables is called an oxygen­hemoglobin dissociation curve. Factors Determining the Affinity of Hemoglobin for Oxygen: 1. Partial Pressure of Oxygen – the partial pressure of oxygen affects hemoglobin saturation as described in the graph on the previous page. The difference in hemoglobin saturation between arterial and venous blood represents the oxygen exchange between capilarries and systemic body tissues. 2. Termperature – decreases hemoglobin affinity for oxygen (less hemoglobin saturation) 3. 2,3­diphosphoglycerate – decreases hemoglobin affinity for oxygen (less hemoglobin saturation) 4. Acidity ([H+]) – decreases hemoglobin affinity for oxygen (less hemoglobin saturation) 5. Carbon Dioxide – decreases hemoglobin affinity for oxygen (less hemoglobin saturation) Transport of Carbon Dioxide in Blood – CO is a wa2 e product that is toxic because it generates H . Large changes in H concentration will lead to changes in pH. This is seen through the +¿ −¿+H ¿ equation: ¿ . Increasing CO 2ncreases [H ]. Blood carries CO +2 O←→H2CO ←→+HCO 2 3 3 more disolved carbon dioxide than oxygen but not all of it disolves. It is therefore necessary to carry carbon dioxide from the tissues to the lungs in other forms. Carbon dioxide acts reversibly with amino acid groups on hemoglobin to form carbaminohemoglobin. The remaining CO is 2 converted to bicarbonate. Carbonic anhydrase is the enzyme responsible for converting CO in 2 water to carbonic acid and then to bicarbonate. Total­blood carbon dioxide is a result of the sum of dissolved CO , 2icarbonate, and carbaminohemoglobin. Transport of Hydrogen Ions between Tissues and Lungs – As stated early, carbon dioxide, which + is generated in the body constantly, increases blood [H ]. The body needs ways of getting rid of excess hydrogen ions to maintain normal blood pH. One regulation method is the buffering system of hemoglobin. While transported, oxyhemoglobin becomes deoxyhemoglobin, which + has a good affinity for H , so it binds to and buffers most of the hydrogen ions. Therefore, only a small amount of H generated remains free. + Conditions involving [H ] – The following conditions are a result of abnormal hydrogen ion concentrations. 1. Respiratory Acidosis – increased arterial hydrogen ion concentration due to carbon dioxide retention. This is caused by hypoventilation. 2. Respiratory Alkalosis – decreased arterial hydrogen ion concentration due to carbon dioxide leaving. This is caused by hyperventilation. Neural Generation of Rhythmic Breathing – Breathing depends entirely upon cyclical respiratory muscle excitation of the diaphragm and intercostal muscles by motor nerves. Control of this neural activity resides in the medulla oblongata, the same area in the brain that contains the major cardiovascular control centers. The medulla respiratory center has 2 main components. 1. Dorsal Respiratory Group – primarily fire during inspiration and have input to the spinal motor neurons that activate respiratory muscles involved in inspiration (diaphragm and inspiratory intercostal muscles) 2. Ventral Respiratory Group – This is the location of the respiratory rhythm generator in the upper portion of the VRG. The respiratory rhythm generator appears to be composed of pacemaker cells as well as a complex neural network that sets sets the basal respiratory rate. The lower part contains nerves that fire during inspiration and experation. Other Control Mechanisms – The apneustic center is the area of the lower pons. The apneustic center sends input signals to the medullary respiratory center and fine­tunes its output. The area of the upper pons is called the pneumotaxic center. The pneumotaxic center modulates the activity of the apneustic center. PneumotaxicCenter (Upper Pons →ApneusticCenter (Lower Pons )→Medulla→DRG∧VRG Control of Ventilation – Respiratory rate and tidal volume can be increased or decreased over a wide range. The major inputs to the medullary respiratory center are the peripheral chemoreceptors and central chemoreceptors. 1. Peripheral chemoreceptors – these are located in the high neck at the bifurcation of the common carotid arteries and in the thorax on the arch of the aorta. These are called carotid bodies and aortic bodies, respectively. These are next to, but distinct from, the arterial baroreceptors and are in direct contact with arterial blood. These receptor cells are + stimulated by a decrease in arterial P anO2 n increase in [H ]. These receptors synapse with afferent neurons that travel to the brainstem, where they provide excitatory synaptic input to the medullary inspiratory neurons. The carotid body is the primary control or respiration. 2. Central chemoreceptors – these are located in the medulla and provide excitatory synaptic input to the medullary inspiratory neurons. They are stimulated by an increase in [H ] of + the brain’s extracellular fluid. Reflex Arcs – There are several reflex arcs that need to be understood for the test and are shown in the following pictures. Events Leading to Hyperventilation: Control of Ventilation: Sleep Apnea – this disease is characterized by periodic cessation of breathing during sleep, which results in hypoxemia and hypercapnia (asphyxia). It is described by the following reflex arc:

Step 2 of 3

Chapter 21, Problem 21-1 is Solved
Step 3 of 3

Textbook: Introduction to Algorithms
Edition: 3
Author: Thomas H. Cormen
ISBN: 9780262033848

Other solutions

People also purchased

Related chapters

Unlock Textbook Solution

Enter your email below to unlock your verified solution to:

Off-line minimum The off-line minimum problem asks us to