text stringlengths 1 3.55k | source stringlengths 24 207 | emb listlengths 1.02k 1.02k |
|---|---|---|
adjacent to each other. graphs are unique in that they can directly represent a wide variety of real - world problems, such as the following : β’ a social network, where each vertex is a person, and each edge is a friendship. β’ the web, where each vertex is a webpage, and each edge is a link. β’ a campus map, where each ... | openstax_introduction_to_computer_science_-_web | [
-0.00810339767485857,
0.01906093768775463,
0.012301595881581306,
-0.011629187501966953,
0.0400993786752224,
-0.019718056544661522,
-0.010082663036882877,
-0.007750518620014191,
0.006038758438080549,
0.06602290272712708,
0.02267013117671013,
-0.027010999619960785,
0.02057524025440216,
-0.02... |
a history of the spread of the disease for epidemiologists to understand how the disease moves through communities. for example, if each vertex includes identity characteristic data such as age, race, or gender, epidemiologists can study which groups of people are most affected by the disease. this can then inform the ... | openstax_introduction_to_computer_science_-_web | [
0.005302145145833492,
0.04046773910522461,
-0.02397886849939823,
-0.016002940014004707,
0.049853403121232986,
-0.012673284858465195,
-0.016690196469426155,
0.033821288496255875,
-0.004266305826604366,
0.031095078215003014,
-0.0059186844155192375,
-0.027822140604257584,
0.023611079901456833,
... |
3. 1 β’ introduction to data structures and algorithms 99 complex data now that we have seen several data structure implementations for abstract data, let us consider how these data structures are used in practice. recall that we compared calculators whose algorithms operated on numbers with the idea of a computer whose... | openstax_introduction_to_computer_science_-_web | [
-0.0072381203062832355,
-0.009303799830377102,
0.03649529814720154,
-0.01859275810420513,
0.04370712488889694,
0.00978204607963562,
-0.0051038083620369434,
0.0023672967217862606,
0.009157645516097546,
0.08117955923080444,
0.020413490012288094,
-0.02176642045378685,
-0.015996528789401054,
-... |
3. 2 algorithm design and discovery learning objectives by the end of this section, you will be able to : β’ understand the approach to solving algorithmic problems β’ explain how algorithm design patterns are used to solve new problems β’ describe how algorithms are analyzed our introduction to data structures focused pr... | openstax_introduction_to_computer_science_-_web | [
0.00459525641053915,
0.010872654616832733,
0.041778311133384705,
-0.02102711610496044,
0.012559102848172188,
-0.008565688505768776,
-0.019107140600681305,
-0.0054705035872757435,
-0.008396212011575699,
0.0846925601363182,
0.009688408114016056,
-0.004732434172183275,
0.0023382678627967834,
... |
solve problems with computers, but this mathematical approach remains the dominant approach in the field. here are a few well - known problems in computer science that we will explore later in this chapter. a data structure problem is a computational problem involving the storage and retrieval of elements for implement... | openstax_introduction_to_computer_science_-_web | [
-0.005571338348090649,
-0.019631771370768547,
0.03053434193134308,
-0.01099878828972578,
0.020297527313232422,
0.0029566017910838127,
0.010514955036342144,
-0.012241397984325886,
-0.007535511162132025,
0.08767034858465195,
0.04012434557080269,
-0.024781333282589912,
0.030627058818936348,
-... |
medical system might want to decide which drugs to administer to which patients, so the algorithm designer might decide to model patients as a complex data type consisting of age, sex, weight, or other physical characteristics. because models represent abstractions, or simplifications of real phenomena, a model must em... | openstax_introduction_to_computer_science_-_web | [
0.01637306623160839,
-0.03244257718324661,
0.025698041543364525,
-0.030165592208504677,
-0.003142052562907338,
-0.02777557633817196,
0.00009526371286483482,
-0.01755438558757305,
-0.04469382390379906,
0.055394574999809265,
0.03075924701988697,
-0.04717471823096275,
0.0331932008266449,
-0.0... |
create a useful algorithm. the relationship between algorithms, the software they empower, and the social outcomes they produce is currently the center of contested social and political debate. for example, all media platforms ( e. g., netflix, hulu, and others ) use some level of targeted advertising based on user pre... | openstax_introduction_to_computer_science_-_web | [
0.01524662971496582,
0.03943497687578201,
0.0019122861558571458,
0.0012500075390562415,
0.002141765784472227,
-0.021563401445746422,
-0.0064866128377616405,
0.01052592508494854,
-0.011499068699777126,
0.032389961183071136,
-0.013867142610251904,
0.0009544453350827098,
0.029418710619211197,
... |
3. 2 β’ algorithm design and discovery 101 specific movies or shows to their users. users may not want their information to be used in this way, but there must be some degree of compromise to make these platforms attractive and useful to people. on the one hand, the technical definition of an algorithm is that it repres... | openstax_introduction_to_computer_science_-_web | [
0.012973650358617306,
0.008482304401695728,
0.01903684437274933,
-0.017469516023993492,
0.022832835093140602,
-0.04653222858905792,
-0.030888060107827187,
-0.02333757095038891,
-0.029635144397616386,
0.04516405984759331,
0.015623871237039566,
-0.015493296086788177,
0.029805511236190796,
-0... |
using formal logic. industry spotlight machine learning algorithms a machine learning algorithm addresses these kinds of problems by using an alternative model of computation, one that focuses on generalized algorithms designed to solve problems with a massive model of the underlying phenomena. instead of attempting to... | openstax_introduction_to_computer_science_-_web | [
0.025384841486811638,
-0.015795549377799034,
0.014927142299711704,
0.0015533323166891932,
0.029711946845054626,
-0.012092623859643936,
-0.0014392671873793006,
-0.021534834057092667,
-0.0212787464261055,
0.07363346964120865,
0.020784039050340652,
-0.020992238074541092,
-0.01421763002872467,
... |
example, suppose we want to find the target term in a dictionary that contains thousands or millions of terms and their associated definitions. if we represent this dictionary as a list, the search algorithm would return the index of the term in the dictionary. if we represent this dictionary as a set, the search algor... | openstax_introduction_to_computer_science_-_web | [
-0.015815623104572296,
-0.027450811117887497,
0.015293890610337257,
-0.012747528031468391,
0.0012091828975826502,
-0.013408397324383259,
-0.030549462884664536,
-0.019727448001503944,
-0.010089550167322159,
0.06106860563158989,
0.030407093465328217,
-0.01343667134642601,
-0.012590054422616959... |
checking each number in order. ( attribution : copyright rice university, openstax, under cc by 4. 0 license ) | openstax_introduction_to_computer_science_-_web | [
-0.007669699843972921,
-0.013658657670021057,
0.022965501993894577,
-0.018910111859440804,
-0.010633484460413456,
-0.02620459347963333,
-0.02407544106245041,
-0.00008223997429013252,
0.022243840619921684,
0.08457133173942566,
0.012252368964254856,
0.01700359396636486,
-0.0068425824865698814,... |
3. 2 β’ algorithm design and discovery 103 figure 3. 10 a binary search can find the number 47 in an array by determining whether the desired number comes before or after a chosen number. it eliminates half of existing data points and then searches in the remaining half, repeating the pattern, until the number is found.... | openstax_introduction_to_computer_science_-_web | [
0.0030078168492764235,
0.0017070500180125237,
0.01834712363779545,
-0.043892860412597656,
-0.006254896521568298,
-0.01851523295044899,
-0.01713419146835804,
-0.016134636476635933,
0.013703017495572567,
0.09878230094909668,
0.04477176070213318,
0.001428975723683834,
0.013260832987725735,
-0... |
ways we could go about solving this problem. one approach is to apply the sequential search design pattern to the list of possible words ( figure 3. 11 ). for each term in the list, we add it to the result if it matches the prefix query. another approach is to first sort the list of potential terms and then apply two b... | openstax_introduction_to_computer_science_-_web | [
-0.005237404257059097,
0.018811047077178955,
0.011309650726616383,
-0.004027155227959156,
-0.010750699788331985,
-0.019298410043120384,
-0.010008580051362514,
-0.011371669359505177,
0.03041384182870388,
0.07146372646093369,
0.02329608052968979,
0.018592042848467827,
0.0014796137111261487,
... |
4. 0 license ) technology in everyday life online autocomplete algorithms in online mapping, autocomplete might take the prefix sea and automatically suggest the city seattle. we know that search algorithms solve this problem by maintaining a sorted collection of place suggestions. but many online mapping applications ... | openstax_introduction_to_computer_science_-_web | [
0.0020319644827395678,
0.013913697563111782,
0.03670290857553482,
-0.0007353025721386075,
0.01057715155184269,
-0.011294914409518242,
-0.01010291650891304,
-0.004230970051139593,
0.029100000858306885,
0.053678348660469055,
0.037776507437229156,
-0.00848857406526804,
-0.0005830469308421016,
... |
not only due to generality, but also due to ambiguity. earlier, we saw how canonical searching algorithms may have different outputs according to the input | openstax_introduction_to_computer_science_-_web | [
0.011275162920355797,
0.006161713041365147,
0.009392890147864819,
-0.007973946630954742,
-0.038610752671957016,
0.0027714516036212444,
-0.01811923272907734,
0.0048009785823524,
0.025225792080163956,
0.04897385090589523,
0.055027395486831665,
-0.008588382974267006,
-0.022315382957458496,
-0... |
3. 2 β’ algorithm design and discovery 105 collection type. what happens if the target term contains special characters or misspellings? should the algorithm attempt to find the closest match? some ambiguities can be resolved by being explicit about the expected output, but there are also cases where ambiguity simply ca... | openstax_introduction_to_computer_science_-_web | [
0.003536071628332138,
0.003581529948860407,
0.021450111642479897,
0.03271448612213135,
-0.0025035508442670107,
-0.021836720407009125,
0.012358986772596836,
0.010376405902206898,
-0.02453385479748249,
0.04370207339525223,
0.021431241184473038,
-0.0016700737178325653,
-0.01411833893507719,
-... |
, know their place, be controlled, be disciplined2 noble β s critique extends further to consider the intersection of social identities such as race and gender as they relate to the outputs of algorithms that support our daily life. global issues in technology searching for identity in algorithms of oppression, safiya ... | openstax_introduction_to_computer_science_-_web | [
0.015248279087245464,
0.0019854374695569277,
-0.0013447660021483898,
-0.0012119011953473091,
0.019259711727499962,
-0.034515202045440674,
-0.04304127022624016,
0.0007448807591572404,
-0.022311126813292503,
0.028624096885323524,
0.017570242285728455,
-0.0005899971001781523,
0.0117512848228216... |
, or methods for managing content shared between the platform users. some researchers argue that content moderation defines a social network platform ; in other words, content moderation policies determine exactly what content can be shared on the platform, which in turn defines the value of information. as social medi... | openstax_introduction_to_computer_science_-_web | [
0.005021324381232262,
0.025553207844495773,
-0.012023075483739376,
0.057630863040685654,
0.030177967622876167,
0.007251244969666004,
-0.010658866725862026,
0.002472445135936141,
0.0030340426601469517,
0.015762582421302795,
-0.029439903795719147,
-0.0069607095792889595,
0.007496729027479887,
... |
3. 3 formal properties of algorithms learning objectives by the end of this section, you will be able to : β’ understand time and space complexity β’ compare and contrast asymptotic analysis with experimental analysis β’ explain the big o notation for orders of growth beyond analyzing an algorithm by examining its outputs... | openstax_introduction_to_computer_science_-_web | [
-0.02082567662000656,
0.03201175108551979,
0.014868902042508125,
-0.03174884617328644,
0.02872825227677822,
-0.013146601617336273,
-0.02592846006155014,
-0.003522686194628477,
0.010513066314160824,
0.053609877824783325,
-0.0020950150210410357,
0.006299708038568497,
-0.007011787500232458,
-... |
3. 3 β’ formal properties of algorithms 107 already have a working program. programming large systems can be expensive and time - consuming, so many organizations want to compare multiple algorithm designs and approaches to identify the most suitable design before implementing the system. even with sample programs to re... | openstax_introduction_to_computer_science_-_web | [
0.01433381624519825,
0.009187852032482624,
0.0037375560496002436,
-0.005824280437082052,
0.04967516288161278,
-0.008561421185731888,
-0.021895281970500946,
-0.013150209560990334,
0.0026994473300874233,
0.044655151665210724,
0.03583519160747528,
-0.016051877290010452,
0.00938167329877615,
-... |
require the most resources. the x - axis shows relative duration and the width indicates the percentage of total duration spent in a function. ( attribution : copyright rice university, openstax, under cc by 4. 0 license ) time and space complexity one way to measure the efficiency of an algorithm is through time compl... | openstax_introduction_to_computer_science_-_web | [
0.011890294961631298,
0.01720089092850685,
0.024568192660808563,
0.0041509959846735,
0.02175210602581501,
-0.016981087625026703,
-0.029378630220890045,
-0.0006244995747692883,
-0.018504673615098,
0.05834469944238663,
0.03469809517264366,
0.01914854347705841,
-0.04261027276515961,
-0.051974... |
. if it is not, then continue to the next word in the list and repeat the process. the first task is to identify a metric for representing the size of the problem. typically, time complexity analysis assumes asymptotic analysis, focusing on evaluating the time that an algorithm takes to produce a result as the size of ... | openstax_introduction_to_computer_science_-_web | [
0.010260249488055706,
0.013681470416486263,
0.04246107116341591,
0.0021173565182834864,
-0.009161136113107204,
-0.010593216866254807,
-0.02603408694267273,
-0.014656939543783665,
0.003507285611703992,
0.07582640647888184,
0.048495348542928696,
-0.02088259533047676,
-0.02373914234340191,
-0... |
simplify our analysis. however, this analysis is not quite complete. we might find the target word early in the list even if the list is very large. although we defined the size of the problem as the number of words in the list, the size of the problem does not account for the exact words and word ordering in the list.... | openstax_introduction_to_computer_science_-_web | [
0.003978975582867861,
-0.0018173924181610346,
0.026930125430226326,
0.008626991882920265,
-0.008360137231647968,
-0.059187151491642,
-0.011336083523929119,
-0.0018127355724573135,
-0.00012684965622611344,
0.06555712223052979,
0.05867042392492294,
-0.020844601094722748,
-0.014644368551671505,... |
3. 3 β’ formal properties of algorithms 109 figure 3. 13 the best case for sequential search in a sorted list is to find the word at the top of the list, whereas the worst case is to find the word at the bottom of the list ( or not in the list at all ). ( attribution : copyright rice university, openstax, under cc by 4.... | openstax_introduction_to_computer_science_-_web | [
0.0029697080608457327,
-0.017483431845903397,
0.031683240085840225,
-0.007122673559933901,
0.025215284898877144,
-0.030650535598397255,
-0.023025546222925186,
0.026335978880524635,
0.021627049893140793,
0.08168479055166245,
0.03548875078558922,
-0.01100807636976242,
-0.024912644177675247,
... |
to use this algorithm or explore other algorithm designs and approaches. we might compare this sequential search algorithm to the binary search algorithm and adjust our algorithm design accordingly. 110 3 β’ data structures and algorithms access for free at openstax. org figure 3. 14 the order of growth of an algorithm ... | openstax_introduction_to_computer_science_-_web | [
-0.008073805831372738,
-0.0006730712484568357,
0.018455183133482933,
0.00997707899659872,
0.015177963301539421,
-0.016228867694735527,
-0.005577791482210159,
0.023670731112360954,
0.02439728006720543,
0.07747358828783035,
0.047001902014017105,
-0.000605432316660881,
-0.022349897772073746,
... |
as β o ( n ) with respect to n, the size of the problem. β big o notation formalizes the concept of a prediction. given the size of the problem, n, calculate how long it takes to run the algorithm on a problem of that size. for large lists, in order to double the worst - case runtime of sequential search, we would need... | openstax_introduction_to_computer_science_-_web | [
0.0038267995696514845,
-0.019843608140945435,
0.01824725791811943,
-0.012535734102129936,
0.009557695128023624,
-0.01710306480526924,
0.019146587699651718,
0.009452597238123417,
0.020440107211470604,
0.07675572484731674,
0.07850047945976257,
-0.000198170033399947,
-0.01690228097140789,
-0.... |
3. 3 β’ formal properties of algorithms 111 large number tells how many times it needs to be divided by a small number until it reaches 1. the binary logarithm, or log2, tells how many times a large number needs to be divided by 2 until it reaches 1. in the worst case, the time complexity of sequential search is in o ( ... | openstax_introduction_to_computer_science_-_web | [
0.0250138808041811,
0.008517644368112087,
0.025344768539071083,
-0.004367102403193712,
0.01618831232190132,
-0.029473355039954185,
-0.015656504780054092,
-0.0003544978972058743,
0.009669126942753792,
0.11183381080627441,
0.07040739059448242,
0.000511515885591507,
-0.02382032945752144,
-0.0... |
order of growth responds differently oversimplifies the problem. rigorously speaking, a function f ( n ) expressed in the big - o notation as being is in the class of o ( g ( n ) ) can be much more complex than the simple function g ( n ). for example, f ( n ) = 4log n + 100 log ( log n ) is in o ( log n ), but when n ... | openstax_introduction_to_computer_science_-_web | [
0.038716480135917664,
0.02113225683569908,
0.017939826473593712,
0.01566752791404724,
0.02052963152527809,
-0.012488243170082569,
0.013621947728097439,
-0.0040468196384608746,
0.02460070140659809,
0.08302765339612961,
0.06640873104333878,
-0.001102333189919591,
0.004542300943285227,
-0.038... |
arranging invisible icons in quadratic time have you ever been annoyed by computer slowness? for some users, opening the start menu can take 20 seconds because of an o ( n2 ) algorithm, where n is the number of desktop files. the microsoft windows computer operating system allows users to organize files directly on top... | openstax_introduction_to_computer_science_-_web | [
-0.009583953768014908,
0.007454446516931057,
0.029161585494875908,
-0.005299991462379694,
0.023190049454569817,
-0.02659665234386921,
-0.012390047311782837,
0.02568441443145275,
0.014873099513351917,
0.07676342129707336,
0.01620909757912159,
0.02439054287970066,
-0.019339073449373245,
-0.0... |
3. 4 algorithmic paradigms learning objectives by the end of this section, you will be able to : β’ apply the divide and conquer technique β’ explain the brute - force method β’ interpret and apply the greedy method β’ understand how to apply reductions to solve problems algorithm design patterns are solutions to well - kn... | openstax_introduction_to_computer_science_-_web | [
0.018114035949110985,
0.003946184646338224,
0.005263472441583872,
-0.018315767869353294,
0.005702206399291754,
-0.038319069892168045,
-0.014743919484317303,
-0.008363441564142704,
0.006023515481501818,
0.10815388709306717,
0.021167287603020668,
0.004958705045282841,
-0.006502456497400999,
... |
randomascii. wordpress. com / 2021 / 02 / 16 / arranging - invisible - icons - in - quadratic - time / | openstax_introduction_to_computer_science_-_web | [
-0.01052052341401577,
0.0014837088529020548,
-0.00591664481908083,
0.025772590190172195,
-0.007901417091488838,
-0.05858151987195015,
0.038536373525857925,
0.02149222604930401,
0.029544856399297714,
0.05531295761466026,
0.0353025421500206,
0.01566370576620102,
0.008303117007017136,
-0.0430... |
3. 4 β’ algorithmic paradigms 113 earlier, we introduced binary search to find a target within a sorted list as an analogy for finding a term in a dictionary sorted alphabetically. instead of starting from the beginning of the dictionary and checking each term, as in a sequential search, we could instead start from the ... | openstax_introduction_to_computer_science_-_web | [
0.0020609551575034857,
-0.025448527187108994,
0.0023497857619076967,
-0.02419411577284336,
-0.0026524069253355265,
-0.0197315514087677,
-0.027970528230071068,
0.016329672187566757,
0.013681861571967602,
0.07760226726531982,
0.031635917723178864,
-0.017390161752700806,
0.005699392408132553,
... |
elements in an unknown order, a sorting algorithm should return a new list containing the same elements rearranged into a logical order, such as least to greatest. one canonical divide and conquer algorithm for comparison sorting is called merge sort. the problem of comparison sorting is grounded in the comparison oper... | openstax_introduction_to_computer_science_-_web | [
-0.0009042412275448442,
-0.042304132133722305,
-0.0005471741897054017,
-0.02336769364774227,
-0.006057185120880604,
-0.0008589482167735696,
-0.02195003628730774,
0.004754957742989063,
0.018776260316371918,
0.08137153834104538,
0.013586203567683697,
0.007917782291769981,
0.017827199772000313,... |
force algorithms solving a combinatorial problem involves identifying the best candidate solution out of a space of many potential solutions. each solution to a combinatorial problem is represented as a complex data type. many applications that involve simulating and comparing different options can be posed as combinat... | openstax_introduction_to_computer_science_-_web | [
0.01510136853903532,
0.01242406852543354,
0.004762142430990934,
-0.012190953828394413,
-0.03111720271408558,
-0.018874220550060272,
-0.026279395446181297,
0.0043528093956410885,
0.0033590032253414392,
0.08346055448055267,
0.04386491701006889,
0.018405470997095108,
0.017977513372898102,
-0.... |
##rate all potential solutions, a brute - force algorithm must generate every possible combination of the input data. for example, if a credit card number has sixteen digits and each digit can have any value between zero and nine, then there are 1016 potential credit card numbers to enumerate. the combinatorial explosi... | openstax_introduction_to_computer_science_-_web | [
-0.00024925291654653847,
0.009256377816200256,
0.032509855926036835,
-0.013707399368286133,
-0.035699211061000824,
-0.04597824439406395,
-0.006476304959505796,
0.007682555355131626,
0.018702002242207527,
0.054979290813207626,
0.05545809492468834,
0.026534706354141235,
0.02375807985663414,
... |
3. 4 β’ algorithmic paradigms 115 industry spotlight protein folding proteins are one of the fundamental building blocks of biological life. the 3 - d shape of a protein defines what it does and how it works. given the string of a protein β s amino acids, a protein - folding problem asks us to compute the 3 - d shape of... | openstax_introduction_to_computer_science_-_web | [
0.03221161663532257,
-0.006276644300669432,
0.04614172875881195,
-0.015824010595679283,
-0.009469250217080116,
0.033909156918525696,
-0.0042577628046274185,
0.003708752105012536,
-0.009599889628589153,
0.0562451146543026,
0.03175335004925728,
-0.0386430099606514,
0.016300419345498085,
-0.0... |
tool, rosetta, to create entirely new proteins. greedy algorithms a greedy algorithm solves combinatorial problems by repeatedly applying a simple rule to select the next element to include in the solution. unlike brute - force algorithms that solve combinatorial problems by generating all potential solutions, greedy a... | openstax_introduction_to_computer_science_-_web | [
0.008334075100719929,
0.029341604560613632,
0.0029189297929406166,
-0.020213330164551735,
-0.025946028530597687,
-0.028699934482574463,
-0.008797145448625088,
0.004018719308078289,
-0.0017791475402191281,
0.07139325886964798,
0.027505626901984215,
-0.032863568514585495,
0.00914575532078743,
... |
awarded - nobel - prize - in - chemistry / 116 3 β’ data structures and algorithms access for free at openstax. org figure 3. 18 greedy interval scheduling will not work if the simple rule repeatedly selects the shortest interval. ( attribution : copyright rice university, openstax, under cc by 4. 0 license ) the majori... | openstax_introduction_to_computer_science_-_web | [
0.01356294471770525,
0.01800830103456974,
0.016435565426945686,
0.020437106490135193,
0.0036069853231310844,
-0.02533947490155697,
-0.02249465323984623,
-0.0015417818212881684,
0.02912166342139244,
0.07319830358028412,
0.03813905641436577,
-0.04839959740638733,
0.02001107856631279,
-0.0465... |
to modern speeds, fail to provide service to all residents, and / or charge outrageous rates. β 7 while a minimum spanning tree algorithm can solve the municipal broadband planning problem, the challenges of deploying municipal broadband for everyone is more political rather than algorithmic. but other algorithms can a... | openstax_introduction_to_computer_science_-_web | [
0.01495792530477047,
0.02603035420179367,
-0.04638226330280304,
0.029745765030384064,
0.03798327222466469,
-0.02167942002415657,
-0.022085251286625862,
-0.008545629680156708,
0.04391802102327347,
0.08305050432682037,
0.004067476838827133,
-0.014976120553910732,
0.03940969333052635,
-0.0405... |
3. 4 β’ algorithmic paradigms 117 deployment, and integration of new technologies so that marginalized communities can realize the positive economic benefits first. or we can reconfigure the minimum spanning trees problem model to take specifically account for expanding network access in an equitable fashion. computer s... | openstax_introduction_to_computer_science_-_web | [
0.01966170035302639,
0.011653942056000233,
0.031476765871047974,
0.007387205492705107,
0.017338892444968224,
-0.02029579132795334,
-0.03689177706837654,
-0.01730421371757984,
-0.003735954174771905,
0.06055917218327522,
0.016692806035280228,
-0.03871884569525719,
-0.010552437976002693,
-0.0... |
to solve the original problem. ( attribution : copyright rice university, openstax, under cc by 4. 0 license ) consider a slightly different version of the municipal broadband planning problem, where instead of only considering connections ( edges ), we expand the problem to consider the possibility of installing broad... | openstax_introduction_to_computer_science_-_web | [
0.0178215354681015,
0.02061786875128746,
-0.01515686884522438,
0.0007356803398579359,
0.028383085504174232,
-0.0062837800942361355,
-0.02854304015636444,
-0.0004642353451345116,
0.03260397911071777,
0.049286551773548126,
0.033498428761959076,
-0.02520740032196045,
0.00878025684505701,
-0.0... |
4. 0 license ) we say that this more complicated municipal broadband planning problem reduces to the minimum spanning tree problem because we can design a reduction algorithm consisting of preprocessing and postprocessing procedures. β’ preprocess : introduce an extra vertex that does not represent a real location but c... | openstax_introduction_to_computer_science_-_web | [
0.001079761073924601,
0.0018215314485132694,
0.01515530701726675,
-0.0085736820474267,
0.02918880805373192,
-0.016633398830890656,
-0.030200950801372528,
-0.012924098409712315,
0.024464547634124756,
0.0630706399679184,
0.03282397240400314,
-0.04286381974816322,
-0.006801183335483074,
-0.05... |
3. 5 sample algorithms by problem learning objectives by the end of this section, you will be able to : β’ discover algorithms that solve data structure problems β’ understand graph problems and related algorithms earlier, we introduced several computing problems, like searching for a target value in a list or implementi... | openstax_introduction_to_computer_science_-_web | [
0.01612444594502449,
-0.0043878499418497086,
0.03157881274819374,
-0.020759642124176025,
-0.0021210561972111464,
-0.006151056382805109,
-0.028800316154956818,
0.018874874338507652,
0.002578183077275753,
0.07289382815361023,
0.034592557698488235,
-0.015585028566420078,
0.022898662835359573,
... |
3. 5 β’ sample algorithms by problem 119 data structure problems data structure problems are not only useful for implementing data structures, but also as fundamental algorithm design patterns for organizing data to enable efficient solutions to almost every other computing problem. searching searching is the problem of... | openstax_introduction_to_computer_science_-_web | [
-0.005806995090097189,
0.010707205161452293,
0.020151931792497635,
-0.0004215605731587857,
0.027409803122282028,
-0.007815721444785595,
0.0038554673083126545,
-0.002310348441824317,
0.012202664278447628,
0.09315117448568344,
0.02975899539887905,
-0.0388571172952652,
0.0006148180109448731,
... |
##cient on linked lists, which do not enable constant - time access to elements by index. binary search relies on the structure of the sorted list to repeatedly rule - out half of the remaining elements. binary search trees represent the concept of binary search in a tree data structure by arranging elements in the tre... | openstax_introduction_to_computer_science_-_web | [
-0.008629513904452324,
-0.014691927470266819,
-0.0034296121448278427,
-0.0016567116836085916,
0.038372963666915894,
0.003350138897076249,
-0.006338746286928654,
0.008815299719572067,
0.015132755972445011,
0.08505915105342865,
0.01880049705505371,
-0.054385121911764145,
0.02310839854180813,
... |
order. merge sort algorithm a merge sort algorithm recursively divides the data into sublists until sublists are one element long β which we know are sorted β and then merges adjacent sorted sublists to eventually return the sorted list. the merge operation combines two sorted sublists to produce a new, larger sorted s... | openstax_introduction_to_computer_science_-_web | [
-0.006907501723617315,
-0.003984135575592518,
-0.019735470414161682,
0.0028435643762350082,
0.013292799703776836,
-0.009584865532815456,
-0.004212645813822746,
-0.0017299775499850512,
0.04122275114059448,
0.10441526770591736,
0.01479237712919712,
-0.011951824650168419,
0.01662539318203926,
... |
3. 23 ). figure 3. 23 quicksort is a divide and conquer sorting algorithm that sorts elements by recursively partitioning elements around a pivot. ( attribution : copyright rice university, openstax, under cc by 4. 0 license ) heapsort algorithm a heapsort algorithm adds all elements to a binary heap priority queue dat... | openstax_introduction_to_computer_science_-_web | [
-0.021915555000305176,
-0.00421205023303628,
-0.008111213333904743,
0.004956850782036781,
0.025449471548199654,
0.01747332699596882,
-0.0011577382683753967,
0.00005640948438667692,
0.011759738437831402,
0.10272853821516037,
0.01080265361815691,
-0.02821945771574974,
0.023544220253825188,
-... |
3. 5 β’ sample algorithms by problem 121 figure 3. 24 heapsort uses the binary heap data structure to sort elements by adding and then removing all elements from the heap. ( attribution : copyright rice university, openstax, under cc by 4. 0 license ) many comparison sorting algorithms share the same o ( n log n ) runti... | openstax_introduction_to_computer_science_-_web | [
-0.0032519095111638308,
-0.004236096050590277,
0.0040175882168114185,
-0.01474564429372549,
0.03403723984956741,
0.009663713164627552,
-0.01999548263847828,
0.0005409386940300465,
0.013345222920179367,
0.09261001646518707,
0.03164413198828697,
-0.037525441497564316,
0.012732776813209057,
-... |
##ranging the categories into a logical order. for example, the problem of sorting a deck of cards can be seen as a count sorting problem if we put the cards into numeric stacks and then rearrange the stacks into a logical order. by changing the assumptions of the problem, count sorting algorithms can run in o ( n ) ti... | openstax_introduction_to_computer_science_-_web | [
-0.008558763191103935,
-0.01030577253550291,
0.02156670205295086,
-0.02815726399421692,
0.008647467941045761,
-0.008411264978349209,
0.0012136746663600206,
-0.00695038540288806,
-0.01910163275897503,
0.1059577465057373,
0.01472726184874773,
-0.020337333902716637,
0.022640831768512726,
-0.0... |
and retrieve elements in an array indexed by hash value. 122 3 β’ data structures and algorithms access for free at openstax. org figure 3. 25 hash tables data structures apply hashing to implement abstract data types such as sets and maps, but must handle collisions between elements that share the same hash value. ( at... | openstax_introduction_to_computer_science_-_web | [
-0.02242947369813919,
-0.0036101241130381823,
0.02523302473127842,
-0.033734094351530075,
0.018731961026787758,
-0.01346470508724451,
-0.009423223324120045,
-0.003316617337986827,
0.014252284541726112,
0.06361836940050125,
-0.0011903907870873809,
0.008683836087584496,
0.02669781632721424,
... |
a graph traversal algorithm that recursively explores each neighbor, continuing as far possible along each subproblem depth - first ( figure 3. 26 ). explored vertices are added to a global set to ensure that the algorithm only explores each vertex once. the runtime of depth - first search is in o ( | v | + | e | ) wit... | openstax_introduction_to_computer_science_-_web | [
0.024745825678110123,
0.021015893667936325,
-0.001392232021316886,
-0.030115855857729912,
0.02548805996775627,
-0.015566226094961166,
-0.029301850125193596,
0.010110914707183838,
0.023963280022144318,
0.059425730258226395,
0.011151604354381561,
-0.014367145486176014,
-0.003928702790290117,
... |
3. 5 β’ sample algorithms by problem 123 figure 3. 26 depth - first search is a graph traversal algorithm that continues as far down a path as possible from a start vertex before backtracking. ( attribution : copyright rice university, openstax, under cc by 4. 0 license ) breadth - first search a breadth - first search ... | openstax_introduction_to_computer_science_-_web | [
0.028031164780259132,
0.0004164479614701122,
0.029756203293800354,
-0.024580061435699463,
0.03610483556985855,
0.009183596819639206,
-0.019986653700470924,
-0.03404116630554199,
0.00003549367102095857,
0.0861528068780899,
0.02439563348889351,
-0.015646731480956078,
0.00721339788287878,
-0.... |
where cost is the sum of the selected edge weights. the two canonical greedy algorithms for finding a minimum spanning tree in a graph are kruskal β s algorithm and prim β s algorithm. both algorithms repeatedly apply the rule of selecting the next lowest - weight edge to an unconnected part of the graph. the output of... | openstax_introduction_to_computer_science_-_web | [
0.007374919019639492,
0.013806933537125587,
0.007873076014220715,
-0.005918390117585659,
0.023333031684160233,
-0.00407659076154232,
-0.03801625221967697,
-0.040138617157936096,
-0.007876263000071049,
0.0604419969022274,
0.0240856371819973,
-0.022721467539668083,
-0.018333276733756065,
-0.... |
##tax, under cc by 4. 0 license ) shortest paths the output of a shortest paths algorithm is a shortest paths tree, the lowest - cost way to get from one vertex to every other vertex in a graph ( figure 3. 30 ). the unweighted shortest path is the problem of finding the shortest paths in terms of the number of edges. g... | openstax_introduction_to_computer_science_-_web | [
0.0015543297631666064,
0.014985986053943634,
-0.02973843552172184,
-0.010447045788168907,
0.00885760597884655,
0.018528923392295837,
-0.02818490006029606,
-0.027005178853869438,
-0.00795908272266388,
0.058844681829214096,
0.04393034800887108,
-0.023244179785251617,
-0.013512257486581802,
-... |
3. 5 β’ sample algorithms by problem 125 figure 3. 30 three shortest paths trees of the lowest - cost way to get from the start vertex to every other vertex in the graph are shown. ( attribution : copyright rice university, openstax, under cc by 4. 0 license ) weighted shortest path a weighted shortest path is the probl... | openstax_introduction_to_computer_science_-_web | [
0.03665255382657051,
0.016718793660402298,
0.0049889469519257545,
0.001179056242108345,
0.00192228180821985,
0.024016575887799263,
-0.03901832550764084,
-0.029602305963635445,
0.00253892270848155,
0.07967370748519897,
0.01892681047320366,
-0.012496273964643478,
-0.003995802253484726,
-0.04... |
figure 3. 31 dijkstra β s algorithm expands outward from the start vertex by repeatedly selecting the next lowest - cost path to an unreached vertex. ( attribution : copyright rice university, openstax, under cc by 4. 0 license ) 126 3 β’ data structures and algorithms access for free at openstax. org | openstax_introduction_to_computer_science_-_web | [
-0.01301390491425991,
0.010037667118012905,
-0.0012872768566012383,
-0.01383629348129034,
-0.006909531075507402,
-0.012110781855881214,
-0.016937630251049995,
-0.0045554786920547485,
0.02923445962369442,
0.1171751320362091,
0.060808874666690826,
0.0018771413015201688,
0.011786317452788353,
... |
3. 6 computer science theory learning objectives by the end of this section, you will be able to : β’ understand the models and limits of computing β’ relate turing machines to algorithms β’ describe complexity classes β’ interpret np - completeness β’ differentiate between p and np throughout this chapter, we have introduc... | openstax_introduction_to_computer_science_-_web | [
0.025920547544956207,
-0.00839791726320982,
0.00977233424782753,
-0.024451659992337227,
0.035090573132038116,
-0.010735949501395226,
-0.033770348876714706,
0.0004190386680420488,
-0.010156731121242046,
0.07646597176790237,
0.036417052149772644,
0.008332452736794949,
0.021617237478494644,
-... |
operations, then it might be possible to deal with combinatorial explosion. almost all of today β s computer hardware, ranging from massive supercomputers to handheld smartphones, rely at least to some degree on expanding the model of computation to compute solutions to problems more efficiently. even so, much of today... | openstax_introduction_to_computer_science_-_web | [
0.0018591579282656312,
-0.01702631637454033,
0.02480458654463291,
-0.027562079951167107,
0.011836286634206772,
-0.003059378359466791,
-0.010066727176308632,
-0.014556679874658585,
0.0032538147643208504,
0.03256397694349289,
0.02536223642528057,
-0.01950058899819851,
-0.011397188529372215,
... |
3. 6 β’ computer science theory 127 b. retrieve a value from the memory bank. c. perform a basic operation on a value. d. set which instruction will be executed next by modifying the program counter. 3. a program counter that keeps track of the current instruction in the instruction table. a turing machine executes a co... | openstax_introduction_to_computer_science_-_web | [
0.01262586284428835,
-0.001167987589724362,
0.011285183019936085,
-0.022347072139382362,
0.024737734347581863,
-0.002321648644283414,
-0.020214006304740906,
-0.019472531974315643,
-0.004908977076411247,
0.05711721256375313,
0.040452830493450165,
0.0050164745189249516,
0.023757753893733025,
... |
over time, inefficient algorithms still cannot be used to solve any problems larger than a few thousand elements. complexity classes one subfield of computer science is theoretical computer science, which studies models of computation, their application to algorithms, and the complexity of problems. the complexity of a... | openstax_introduction_to_computer_science_-_web | [
0.01830325648188591,
-0.00373391667380929,
0.011433681473135948,
-0.015177968889474869,
0.014638056047260761,
0.013237698003649712,
-0.021535174921154976,
0.019764378666877747,
0.005660541821271181,
0.07235856354236603,
0.06434335559606552,
-0.016744637861847878,
0.01077481172978878,
-0.04... |
to simultaneously explore all the possible choices. we do not yet have computers that can execute nondeterministic algorithms, but if we did, then we would be able to efficiently solve any combinatorial problem by relying on the special power of nondeterminism. 128 3 β’ data structures and algorithms access for free at ... | openstax_introduction_to_computer_science_-_web | [
0.022128285840153694,
0.004973219707608223,
0.0029282167088240385,
-0.00490102544426918,
-0.008248008787631989,
-0.006403145380318165,
-0.03495007008314133,
0.02600710093975067,
0.009086106903851032,
0.06622811406850815,
0.03852000832557678,
-0.018763158470392227,
-0.0036471078637987375,
-... |
many edges as possible to maximize distance, visiting many vertices along the way. for some graphs, the longest paths might even visit all the vertices in the graph. in this situation, the longest paths do not form a tree and instead involve ordering all the vertices in the graph for each longest path. identifying the ... | openstax_introduction_to_computer_science_-_web | [
0.010915769264101982,
0.01567470282316208,
-0.014754857867956161,
0.004086627159267664,
0.023197399452328682,
-0.017105400562286377,
-0.04652613028883934,
0.017784835770726204,
-0.004903226625174284,
0.0614301860332489,
0.05086955428123474,
0.008418827317655087,
0.004091858863830566,
-0.04... |
3. 6 β’ computer science theory 129 industry spotlight delivery logistics companies such as amazon, fedex, ups, and others that rely on logistics to deliver goods to various locations seek to optimize the sequence of stops to save costs. the only way to achieve this would be to rely on an optimal algorithm for the trave... | openstax_introduction_to_computer_science_-_web | [
0.02588503435254097,
0.022480515763163567,
0.007323919329792261,
0.025754688307642937,
0.007019059266895056,
-0.0019265961600467563,
-0.033431120216846466,
0.0025979015044867992,
0.014502009376883507,
0.06824317574501038,
0.027043037116527557,
0.0033998398575931787,
0.00818730890750885,
-0... |
to hamiltonian paths ( hp ). in turn, hamiltonian paths ( hp ) reduce to vertex cover ( vc ) which reduces to 3 - satisfiability ( 3 - sat ). p versus np longest paths and tsp are just two among thousands of np - complete problems for which we do not have efficient algorithms. the question of p versus np asks whether i... | openstax_introduction_to_computer_science_-_web | [
0.02941412478685379,
0.011152192018926144,
0.04227512702345848,
0.004015110898762941,
0.007684153970330954,
0.004157454241067171,
-0.013943813741207123,
0.010009009391069412,
0.0006894566467963159,
0.06170742213726044,
0.025904562324285507,
-0.011238873936235905,
-0.006570475175976753,
-0.... |
algorithmic problem solving refers to a particular set of approaches and methods for designing algorithms that draws on computing β s historical connections to the study of mathematical problem solving array list data structure that stores elements next to each other in memory asymptotic analysis evaluates the time tha... | openstax_introduction_to_computer_science_-_web | [
-0.009769323281943798,
0.0019999160431325436,
0.023088879883289337,
0.006342306267470121,
0.0235965084284544,
-0.024301987141370773,
0.006370746996253729,
-0.00919489935040474,
0.003331430722028017,
0.05502958968281746,
0.02433282695710659,
-0.013175316154956818,
0.00988357700407505,
-0.07... |
makes brute - force algorithms unusable in practice combinatorial problem involves identifying the best candidate solution out of a space of many potential solutions comparison sorting sorting of a list of elements where elements are not assigned numeric values but rather defined in relation to other elements complexit... | openstax_introduction_to_computer_science_-_web | [
-0.001037038629874587,
-0.01860632188618183,
0.028822319582104683,
-0.018280189484357834,
-0.009599723853170872,
0.002157005947083235,
-0.004798549227416515,
-0.011144483461976051,
0.010723563842475414,
0.07564883679151535,
0.022564617916941643,
0.004460743162781,
-0.0024334618356078863,
-... |
runtime by recording how long it takes to run a program implementation of it functionality operations such as adding, retrieving, and removing elements graph represents binary relations among collection of entities, specifically vertices and edges graph problem computational problem involving graphs that represent rela... | openstax_introduction_to_computer_science_-_web | [
-0.004735699854791164,
0.012749116867780685,
0.012723859399557114,
-0.006304630544036627,
0.021285586059093475,
0.01029581855982542,
-0.014775415882468224,
-0.036020416766405106,
0.008312315680086613,
0.0635354146361351,
0.0038026778493076563,
-0.015379042364656925,
0.020567040890455246,
-... |
vertices map represents unordered associations between key - value pairs of elements, where each key can only 132 3 β’ chapter review access for free at openstax. org appear once in the map matching problem of searching for a text pattern within a document merge sort canonical divide and conquer algorithm for comparison... | openstax_introduction_to_computer_science_-_web | [
0.010369486175477505,
0.006184335798025131,
0.013001926243305206,
-0.02770591527223587,
0.045652784407138824,
0.014058306813240051,
0.0108431251719594,
-0.0008196819107979536,
0.007445238530635834,
0.06936582177877426,
0.03916317597031593,
-0.019650863483548164,
0.005520289298146963,
-0.06... |
language quicksort algorithm recursively sorts data by applying the binary search tree algorithm design pattern to partition data around pivot elements reachable vertex vertex that can be reached if a path or sequence of edges from the start vertex exists reduction algorithm solves problems by transforming them into ot... | openstax_introduction_to_computer_science_-_web | [
-0.025844143703579903,
0.009922731667757034,
0.0013525052927434444,
-0.022641506046056747,
0.03692619130015373,
0.0032010935246944427,
-0.0022296805400401354,
-0.01781955547630787,
0.01862296089529991,
0.07351888716220856,
0.02027832716703415,
-0.03355913236737251,
-0.0031226053833961487,
... |
of exploring all the vertices in a graph tree hierarchical data structure turing machine abstract model of computation for executing any computer algorithm unweighted shortest path problem of finding the shortest paths in terms of the number of edges vertex represents an element in a graph or special type of it such as... | openstax_introduction_to_computer_science_-_web | [
0.006553022190928459,
-0.0010221831034868956,
-0.025773046538233757,
-0.014671838842332363,
0.03330172225832939,
0.0000012917265621581464,
0.005928684026002884,
0.0025887847878038883,
0.007739742752164602,
0.05530866980552673,
0.043735966086387634,
-0.009358350187540054,
-0.01033524516969919... |
3. 1 introduction to data structures and algorithms β’ data structures represent complex data types for solving real - world problems. data structures combine specific data representations with specific functionality. β’ abstract data types categorize data structures according to their functionality and ignore difference... | openstax_introduction_to_computer_science_-_web | [
-0.0096669252961874,
0.008662032894790173,
0.035434916615486145,
-0.029148142784833908,
0.03396284207701683,
0.020662151277065277,
-0.005515309516340494,
0.0007213791250251234,
0.013971343636512756,
0.08135200291872025,
0.01436970941722393,
-0.015150854364037514,
0.017740469425916672,
-0.0... |
3. 2 algorithm design and discovery β’ just like how many data structures can represent the same abstract data type, many algorithms exist to solve the same problem. in algorithmic problem - solving, computer scientists solve formal problems with specific input data and output data that correspond to each input. β’ model... | openstax_introduction_to_computer_science_-_web | [
0.00046775740338489413,
0.009106862358748913,
0.047153934836387634,
-0.02740665152668953,
0.0650460422039032,
-0.00578157277777791,
-0.012331281788647175,
-0.014964616857469082,
-0.01259675994515419,
0.08684878796339035,
0.015276770107448101,
-0.012937087565660477,
-0.004308030940592289,
-... |
3. 3 formal properties of algorithms β’ runtime analysis is a study of how much time it takes to run an algorithm. experimental analysis is a runtime analysis technique that involves evaluating an algorithm β s runtime by recording how long it takes to run a program implementation of it. β’ time complexity is the formal ... | openstax_introduction_to_computer_science_-_web | [
-0.0028995564207434654,
0.021540723741054535,
0.035954248160123825,
-0.03613528609275818,
0.05023782327771187,
-0.002232072874903679,
-0.004663936793804169,
-0.003351774765178561,
-0.005004728212952614,
0.05909339711070061,
0.006216833367943764,
0.014840273186564445,
-0.033073555678129196,
... |
3. 4 algorithmic paradigms β’ algorithmic paradigms are the common concepts and ideas behind algorithm design patterns, such as divide and conquer algorithms, brute - force algorithms, greedy algorithms, and reduction algorithms. β’ divide and conquer algorithms break down a problem into smaller subproblems ( divide ), r... | openstax_introduction_to_computer_science_-_web | [
0.027431275695562363,
0.0020797739271074533,
0.032627303153276443,
-0.027552517130970955,
-0.016543244943022728,
-0.02736767567694187,
-0.023961154744029045,
-0.00925321877002716,
-0.00418394198641181,
0.10003093630075455,
0.023359905928373337,
-0.0030395356006920338,
0.0056967479176819324,
... |
the minimum spanning trees problem. these algorithms are a rare example of a greedy algorithm that is guaranteed to compute the correct result. β’ reduction algorithms solve problems by transforming them into other problems. in other words, reduction algorithms delegate most of the work of solving the problem to another... | openstax_introduction_to_computer_science_-_web | [
0.002612813375890255,
0.007379334885627031,
0.025940578430891037,
-0.023421432822942734,
0.04095708951354027,
-0.020542019978165627,
-0.027251826599240303,
-0.0024298198986798525,
0.018858201801776886,
0.07000276446342468,
0.036583755165338516,
-0.036072321236133575,
-0.0025396659038960934,
... |
3. 5 sample algorithms by problem β’ data structure problems focus on the storage and retrieval of elements for implementing abstract data types such as lists, sets, maps, and priority queues. data structure problems include sorting, searching, and hashing. β’ searching is the problem of retrieving a target element from ... | openstax_introduction_to_computer_science_-_web | [
-0.0010063637746497989,
-0.007049103733152151,
0.029787927865982056,
-0.0072797490283846855,
0.006203745026141405,
0.014465907588601112,
-0.009215832687914371,
-0.010588616132736206,
0.004845758434385061,
0.08915819972753525,
0.012016944587230682,
-0.034710779786109924,
0.016620608046650887,... |
the problem of finding a lowest - cost way to get from one vertex to another. the output of a shortest paths algorithm is a shortest paths tree from the start vertex to every other vertex in the graph. β’ breadth - first search computes the unweighted shortest paths tree, the shortest paths in terms of the number of edg... | openstax_introduction_to_computer_science_-_web | [
-0.0044409604743123055,
0.01883065700531006,
-0.010881809517741203,
-0.016201810911297798,
0.021442271769046783,
0.01183497253805399,
-0.035730380564928055,
-0.024338161572813988,
0.01063139084726572,
0.07124456018209457,
0.023010525852441788,
-0.02121102251112461,
-0.0068788956850767136,
... |
3. 6 computer science theory β’ problem modeling is constrained by the model of computation, or the rules of the underlying computer that is ultimately responsible for executing the algorithm. combinatorial explosion poses a problem for computer algorithms because our model of computation assumes computers only have a s... | openstax_introduction_to_computer_science_-_web | [
0.02989732287824154,
-0.01308330800384283,
0.007482048124074936,
-0.009845536202192307,
0.040448665618896484,
-0.005450940225273371,
-0.010368909686803818,
-0.002323173452168703,
-0.00044878190965391695,
0.0698709785938263,
0.05765723064541817,
-0.005153038538992405,
-0.006798890884965658,
... |
to all the hardest np problems β the combinatorial problems for which we do not have deterministic polynomial - time algorithms. β’ longest paths and the traveling salesperson problem ( tsp ) are two well - known examples of np - complete problems. what makes both these problems difficult is that we do not have a simple... | openstax_introduction_to_computer_science_-_web | [
0.02015496976673603,
0.002941194688901305,
0.02415010705590248,
0.010224767960608006,
0.023439299315214157,
-0.012347624637186527,
-0.018778691068291664,
0.01829027757048607,
0.010065361857414246,
0.08718036115169525,
0.042927179485559464,
-0.017673717811703682,
0.015363910235464573,
-0.02... |
. maps 3 β’ chapter review 137 d. priority queues 4. what is one way to describe the relationship between algorithms, problems, and modeling? a. algorithms are the foundation for problem models. b. algorithms solve a model of a problem. c. each algorithm can only be used to solve a single problem. d. each problem can on... | openstax_introduction_to_computer_science_-_web | [
0.013825532048940659,
0.019283462315797806,
0.01766052655875683,
-0.014426483772695065,
0.015411614440381527,
-0.01586174964904785,
-0.01991475373506546,
-0.004781357478350401,
-0.017337020486593246,
0.10933541506528854,
0.03853437304496765,
-0.0098282964900136,
0.010730679146945477,
-0.07... |
time complexity focuses on asymptotic analysis while space complexity focuses on experimental analysis. d. both time and space complexity can apply methods from asymptotic analysis and experimental analysis. 10. what are the three steps in divide and conquer algorithms? 11. why do many greedy algorithms fail to compute... | openstax_introduction_to_computer_science_-_web | [
0.010816702619194984,
0.014702584594488144,
0.027116162702441216,
-0.02247149869799614,
-0.00008556310785934329,
-0.008859893307089806,
-0.02077171765267849,
-0.011282004415988922,
-0.012322972528636456,
0.10237307846546173,
0.01562921144068241,
-0.014564928598701954,
0.01286387350410223,
... |
##time d. using divide and conquer to always reduce an algorithm to o ( 1 ) runtime 18. what is p versus np? a. p refers to the polynomial time complexity class, whereas np refers to the nondeterministic polynomial time complexity class. b. p refers to any big o notation past o ( n3 ), whereas np refers to any big o no... | openstax_introduction_to_computer_science_-_web | [
0.04901338741183281,
-0.002358343917876482,
0.015260200947523117,
-0.011972430162131786,
-0.0032550522591918707,
-0.006287840660661459,
-0.007635524962097406,
-0.02290363609790802,
0.005944982171058655,
0.07439132779836655,
0.008681251667439938,
-0.010435804724693298,
-0.008080722764134407,
... |
##mic order of growth? 15. both prim β s algorithm and dijkstra β s algorithm are greedy algorithms that organize vertices in a priority queue data structure. what is the difference between the ordering of vertices in the priority queue for prim β s algorithm and dijkstra β s algorithm? 16. what is the relationship bet... | openstax_introduction_to_computer_science_-_web | [
0.020661035552620888,
-0.0012641976354643703,
0.021057341247797012,
-0.01311235036700964,
0.01883498951792717,
0.0028070202097296715,
-0.019164569675922394,
-0.00202021817676723,
0.012243720702826977,
0.05972350016236305,
0.020650625228881836,
-0.015020526014268398,
0.014206024818122387,
-... |
data represented as lists, sets, maps, priority queues, and graphs. 6. there can sometimes be thousands, if not millions, of results that match a web search query. to make this information more helpful to humans, we might want to order the results according to a relevance score such that more - relevant results appear ... | openstax_introduction_to_computer_science_-_web | [
0.0049735005013644695,
0.0013795100385323167,
-0.004416813608258963,
0.017483744770288467,
0.009668861515820026,
0.00549538666382432,
-0.0030558917205780745,
-0.0301013495773077,
0.028531434014439583,
0.09906071424484253,
0.013123719021677971,
-0.019917422905564308,
0.021708307787775993,
-... |
problem under certain conditions. what are the conditions necessary to ensure the runtime of a hashing search algorithm is constant? 15. why is it the case that depth - first search cannot be directly applied to compute an unweighted shortest paths tree? problem set a 1. linked lists and binary search trees are two exa... | openstax_introduction_to_computer_science_-_web | [
0.006035759113729,
-0.035003118216991425,
0.029922103509306908,
-0.00911877490580082,
0.028420645743608475,
0.0055774194188416,
-0.02291036769747734,
0.016059482470154762,
0.010843529365956783,
0.06541666388511658,
0.006564575247466564,
-0.008515649475157261,
0.025154946371912956,
-0.06329... |
linear - time operation with respect to the number of icons. ( perhaps a sequential search is needed to 3 β’ chapter review 141 check that the icon has not already been placed on the desktop. ) what is the big o order of growth of this icon arrangement algorithm with respect to n, the number of desktop icons? 7. why doe... | openstax_introduction_to_computer_science_-_web | [
-0.0002973996743094176,
0.009130028076469898,
0.0010189820313826203,
0.013646954670548439,
0.019511736929416656,
-0.008872500620782375,
0.01122552901506424,
-0.005982457660138607,
0.030340038239955902,
0.06700167804956436,
0.020167946815490723,
-0.009368699043989182,
0.014594703912734985,
... |
lists, sets, and maps to represent these relationships? 3. describe how we might implement the graph abstract data type using other abstract data types such as lists, sets, and / or maps. explain for graphs whose edges have associated weights as well as graphs whose edges do not have associated weights. 4. describe two... | openstax_introduction_to_computer_science_-_web | [
0.008172374218702316,
0.00021873885998502374,
0.038250260055065155,
0.012151709757745266,
-0.010410514660179615,
-0.010046581737697124,
0.007709388621151447,
0.011096256785094738,
0.022850429639220238,
0.09758416563272476,
0.03971750661730766,
-0.018839161843061447,
0.004696405492722988,
-... |
for free at openstax. org 2 - d closest pair problem? 12. what are the recursive subproblems in a divide and conquer algorithm for solving for the closest pair problem? 13. digital images are represented in computers as a 2 - d grid of colored pixels. in image editing, the flood fill problem takes a given starting pixe... | openstax_introduction_to_computer_science_-_web | [
0.019595472142100334,
0.017691537737846375,
0.04016560688614845,
-0.02089802734553814,
0.016593916341662407,
-0.02636854164302349,
0.001726705115288496,
-0.00353218917734921,
0.010883050970733166,
0.09366681426763535,
0.029931923374533653,
-0.005234523676335812,
0.011831419542431831,
-0.04... |
compare to more complicated problem models? 5. the formal definition of big o notation does not exactly match our working definition for orders of growth. do some additional research to explain why binary search is also in o ( n ). 6. since binary search is in o ( n ), it is also true that binary search is in o ( n2 ).... | openstax_introduction_to_computer_science_-_web | [
0.048694394528865814,
-0.01013245340436697,
0.022513385862112045,
-0.005170605145394802,
0.004324554465711117,
-0.013081948272883892,
-0.008425631560385227,
-0.011632692068815231,
0.019251547753810883,
0.10492555797100067,
0.043320219963788986,
-0.012991872616112232,
0.007082304451614618,
... |
deterministic polynomial - time algorithm that returns whether there is a path with exactly cost k ( solving the decision problem ). we also know the cost of the actual longest path. how can we repeatedly apply this decision algorithm to design a polynomial - time longest paths function algorithm? labs 1. simulate pati... | openstax_introduction_to_computer_science_-_web | [
0.02909134328365326,
0.05228732153773308,
-0.023502226918935776,
0.015161219984292984,
-0.004718257579952478,
0.0008186600753106177,
-0.028922084718942642,
-0.00788406003266573,
-0.02126285247504711,
0.09368281066417694,
0.030431577935814857,
0.00490666413679719,
0.01370612159371376,
-0.04... |
of β tilly lockey at the singularityu the netherlands summit 2016 β by sebastiaan ter burg / flicker, cc by 2. 0 ) chapter outline 4. 1 models of computation 4. 2 building c programs 4. 3 parallel programming models | openstax_introduction_to_computer_science_-_web | [
0.03748652711510658,
-0.04449997842311859,
0.008133210241794586,
-0.02262248657643795,
-0.01885031722486019,
-0.011270981281995773,
-0.014070074073970318,
-0.007916226983070374,
-0.024852152913808823,
0.07229991257190704,
0.006174090318381786,
0.014072269201278687,
0.024303141981363297,
-0... |
4. 4 applications of programming models introduction the machines we call β computers, β including modern desktop computers, laptops, and web servers, are remarkably fast and capacious. however, computer hardware is also embedded in devices that do not fit the traditional definition of computers : home appliances, auto... | openstax_introduction_to_computer_science_-_web | [
0.031788915395736694,
-0.008373039774596691,
-0.017311954870820045,
0.007902972400188446,
-0.01714952476322651,
-0.007638854905962944,
-0.00843881070613861,
-0.029847146943211555,
-0.011418800801038742,
0.050045304000377655,
0.002691781846806407,
0.0001520540681667626,
-0.009295831434428692,... |
on a computer, whereas intelligent control is a class of control techniques that use various artificial intelligence computing approaches. for example, artificial intelligence algorithms can accurately determine the intentions of the wearer and control a prosthetic β s motion in an accurate and natural way. internet co... | openstax_introduction_to_computer_science_-_web | [
0.007965275086462498,
0.018566066399216652,
-0.02262006141245365,
0.01689492166042328,
0.02263609506189823,
-0.011455819942057133,
0.015163232572376728,
-0.04926467314362526,
0.009682238101959229,
0.03231443464756012,
0.0007066274993121624,
0.034654244780540466,
0.008106314577162266,
-0.06... |
4. 1 models of computation learning objectives by the end of this section, you will be able to : β’ define low - level programming languages, including assembly language β’ define middle - level and high - level programming languages, such as c and javascript β’ compare and contrast the various programming paradigms algor... | openstax_introduction_to_computer_science_-_web | [
0.01840347796678543,
-0.03989550098776817,
-0.0176538098603487,
-0.007213212084025145,
0.005892306566238403,
-0.005436662118881941,
-0.00618514372035861,
-0.04115079715847969,
-0.04666533321142197,
0.06964972615242004,
0.029477301985025406,
0.015343911945819855,
-0.009274066425859928,
-0.0... |
is used in distributed systems like the google search engine to produce search results for large data sets using a complex algorithm. moving even further away from hardware models, computer scientists have also defined an abstract model, which is a technique that derives simpler high - level conceptual models for a com... | openstax_introduction_to_computer_science_-_web | [
-0.021583756431937218,
-0.02220715582370758,
-0.019690826535224915,
-0.0022597138304263353,
0.02539568580687046,
0.012058577500283718,
0.000012661375876632519,
-0.04777424782514572,
0.005596233066171408,
0.08658089488744736,
0.02564993128180504,
-0.004658553283661604,
-0.018289558589458466,
... |
##al rules. a language β s syntax can define keywords such as β if. β the syntax may include a mathematical operator, a fundamental programming operation that combines values, such as β +. β the syntax can define punctuation such as β ; β. essentially, the syntax gives the precise meaning for what each of these element... | openstax_introduction_to_computer_science_-_web | [
0.011029887944459915,
-0.0017769784899428487,
0.004067668691277504,
-0.0057596974074840546,
0.022698910906910896,
-0.006009089294821024,
0.013206171803176403,
-0.010596483945846558,
-0.008983565494418144,
0.07174748927354813,
0.03448587283492088,
0.009276115335524082,
-0.025421764701604843,
... |
4. 1 β’ models of computation 147 figure 4. 3 a random access machine has unlimited memory cells that can store any arbitrary value. ( attribution : copyright rice university, openstax, under cc by 4. 0 license ) figure 4. 4 a neural turing machine ( ntm ) leverages the pattern matching capabilities of neural networks i... | openstax_introduction_to_computer_science_-_web | [
0.016382426023483276,
0.003613374661654234,
-0.009719450026750565,
-0.011422860436141491,
0.02756037376821041,
-0.01285039633512497,
-0.003178282640874386,
-0.034343890845775604,
-0.02873505838215351,
0.08120360970497131,
0.052336663007736206,
-0.0024886291939765215,
0.008432918228209019,
... |
programming language. it may be surprising that so many different programming models can exist, and that algorithms can be translated from one model to another. however, this translation is by design ; computer science established the church - turing thesis, which is a scientific theory stating that an algorithm can be... | openstax_introduction_to_computer_science_-_web | [
0.011068399995565414,
-0.027943024411797523,
0.0005108309560455382,
-0.048179566860198975,
0.002291729673743248,
-0.00948341190814972,
-0.010958367958664894,
-0.017580222338438034,
-0.028986625373363495,
0.057667918503284454,
0.010148588567972183,
0.012670541182160378,
0.010000567883253098,
... |
kinds of languages. we can think of low - level programming languages in terms of cooking : when you cook a meal from scratch, you control every ingredient and every detail of preparation, so the finished meal has precisely the taste and nutrition that you desire. an alternative is to prepare a meal that uses some prep... | openstax_introduction_to_computer_science_-_web | [
0.00970369577407837,
-0.03452812880277634,
-0.0036308541893959045,
-0.03510097786784172,
-0.002393691334873438,
-0.04478907957673073,
0.022909659892320633,
-0.019012441858649254,
-0.035040922462940216,
0.08192001283168793,
0.011471496894955635,
0.0576266348361969,
-0.004555445164442062,
-0... |
4. 1 β’ models of computation 149 machine code, or binary code, is the only computational model that a computer can execute ; a program written in any other language must be compiled or interpreted into machine code before the program can run. the cpu of a computer is a computer chip capable of executing machine code pr... | openstax_introduction_to_computer_science_-_web | [
0.011548012495040894,
-0.03424635902047157,
-0.02683427184820175,
-0.026030315086245537,
0.03452932834625244,
-0.0009167715907096863,
0.005030210129916668,
-0.05789954960346222,
-0.037134915590286255,
0.07289425283670425,
0.012059175409376621,
0.02323782816529274,
-0.029845761135220528,
-0... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.