1
   2
   3
   4
   5
   6
   7
   8
   9
  10
  11
  12
  13
  14
  15
  16
  17
  18
  19
  20
  21
  22
  23
  24
  25
  26
  27
  28
  29
  30
  31
  32
  33
  34
  35
  36
  37
  38
  39
  40
  41
  42
  43
  44
  45
  46
  47
  48
  49
  50
  51
  52
  53
  54
  55
  56
  57
  58
  59
  60
  61
  62
  63
  64
  65
  66
  67
  68
  69
  70
  71
  72
  73
  74
  75
  76
  77
  78
  79
  80
  81
  82
  83
  84
  85
  86
  87
  88
  89
  90
  91
  92
  93
  94
  95
  96
  97
  98
  99
 100
 101
 102
 103
 104
 105
 106
 107
 108
 109
 110
 111
 112
 113
 114
 115
 116
 117
 118
 119
 120
 121
 122
 123
 124
 125
 126
 127
 128
 129
 130
 131
 132
 133
 134
 135
 136
 137
 138
 139
 140
 141
 142
 143
 144
 145
 146
 147
 148
 149
 150
 151
 152
 153
 154
 155
 156
 157
 158
 159
 160
 161
 162
 163
 164
 165
 166
 167
 168
 169
 170
 171
 172
 173
 174
 175
 176
 177
 178
 179
 180
 181
 182
 183
 184
 185
 186
 187
 188
 189
 190
 191
 192
 193
 194
 195
 196
 197
 198
 199
 200
 201
 202
 203
 204
 205
 206
 207
 208
 209
 210
 211
 212
 213
 214
 215
 216
 217
 218
 219
 220
 221
 222
 223
 224
 225
 226
 227
 228
 229
 230
 231
 232
 233
 234
 235
 236
 237
 238
 239
 240
 241
 242
 243
 244
 245
 246
 247
 248
 249
 250
 251
 252
 253
 254
 255
 256
 257
 258
 259
 260
 261
 262
 263
 264
 265
 266
 267
 268
 269
 270
 271
 272
 273
 274
 275
 276
 277
 278
 279
 280
 281
 282
 283
 284
 285
 286
 287
 288
 289
 290
 291
 292
 293
 294
 295
 296
 297
 298
 299
 300
 301
 302
 303
 304
 305
 306
 307
 308
 309
 310
 311
 312
 313
 314
 315
 316
 317
 318
 319
 320
 321
 322
 323
 324
 325
 326
 327
 328
 329
 330
 331
 332
 333
 334
 335
 336
 337
 338
 339
 340
 341
 342
 343
 344
 345
 346
 347
 348
 349
 350
 351
 352
 353
 354
 355
 356
 357
 358
 359
 360
 361
 362
 363
 364
 365
 366
 367
 368
 369
 370
 371
 372
 373
 374
 375
 376
 377
 378
 379
 380
 381
 382
 383
 384
 385
 386
 387
 388
 389
 390
 391
 392
 393
 394
 395
 396
 397
 398
 399
 400
 401
 402
 403
 404
 405
 406
 407
 408
 409
 410
 411
 412
 413
 414
 415
 416
 417
 418
 419
 420
 421
 422
 423
 424
 425
 426
 427
 428
 429
 430
 431
 432
 433
 434
 435
 436
 437
 438
 439
 440
 441
 442
 443
 444
 445
 446
 447
 448
 449
 450
 451
 452
 453
 454
 455
 456
 457
 458
 459
 460
 461
 462
 463
 464
 465
 466
 467
 468
 469
 470
 471
 472
 473
 474
 475
 476
 477
 478
 479
 480
 481
 482
 483
 484
 485
 486
 487
 488
 489
 490
 491
 492
 493
 494
 495
 496
 497
 498
 499
 500
 501
 502
 503
 504
 505
 506
 507
 508
 509
 510
 511
 512
 513
 514
 515
 516
 517
 518
 519
 520
 521
 522
 523
 524
 525
 526
 527
 528
 529
 530
 531
 532
 533
 534
 535
 536
 537
 538
 539
 540
 541
 542
 543
 544
 545
 546
 547
 548
 549
 550
 551
 552
 553
 554
 555
 556
 557
 558
 559
 560
 561
 562
 563
 564
 565
 566
 567
 568
 569
 570
 571
 572
 573
 574
 575
 576
 577
 578
 579
 580
 581
 582
 583
 584
 585
 586
 587
 588
 589
 590
 591
 592
 593
 594
 595
 596
 597
 598
 599
 600
 601
 602
 603
 604
 605
 606
 607
 608
 609
 610
 611
 612
 613
 614
 615
 616
 617
 618
 619
 620
 621
 622
 623
 624
 625
 626
 627
 628
 629
 630
 631
 632
 633
 634
 635
 636
 637
 638
 639
 640
 641
 642
 643
 644
 645
 646
 647
 648
 649
 650
 651
 652
 653
 654
 655
 656
 657
 658
 659
 660
 661
 662
 663
 664
 665
 666
 667
 668
 669
 670
 671
 672
 673
 674
 675
 676
 677
 678
 679
 680
 681
 682
 683
 684
 685
 686
 687
 688
 689
 690
 691
 692
 693
 694
 695
 696
 697
 698
 699
 700
 701
 702
 703
 704
 705
 706
 707
 708
 709
 710
 711
 712
 713
 714
 715
 716
 717
 718
 719
 720
 721
 722
 723
 724
 725
 726
 727
 728
 729
 730
 731
 732
 733
 734
 735
 736
 737
 738
 739
 740
 741
 742
 743
 744
 745
 746
 747
 748
 749
 750
 751
 752
 753
 754
 755
 756
 757
 758
 759
 760
 761
 762
 763
 764
 765
 766
 767
 768
 769
 770
 771
 772
 773
 774
 775
 776
 777
 778
 779
 780
 781
 782
 783
 784
 785
 786
 787
 788
 789
 790
 791
 792
 793
 794
 795
 796
 797
 798
 799
 800
 801
 802
 803
 804
 805
 806
 807
 808
 809
 810
 811
 812
 813
 814
 815
 816
 817
 818
 819
 820
 821
 822
 823
 824
 825
 826
 827
 828
 829
 830
 831
 832
 833
 834
 835
 836
 837
 838
 839
 840
 841
 842
 843
 844
 845
 846
 847
 848
 849
 850
 851
 852
 853
 854
 855
 856
 857
 858
 859
 860
 861
 862
 863
 864
 865
 866
 867
 868
 869
 870
 871
 872
 873
 874
 875
 876
 877
 878
 879
 880
 881
 882
 883
 884
 885
 886
 887
 888
 889
 890
 891
 892
 893
 894
 895
 896
 897
 898
 899
 900
 901
 902
 903
 904
 905
 906
 907
 908
 909
 910
 911
 912
 913
 914
 915
 916
 917
 918
 919
 920
 921
 922
 923
 924
 925
 926
 927
 928
 929
 930
 931
 932
 933
 934
 935
 936
 937
 938
 939
 940
 941
 942
 943
 944
 945
 946
 947
 948
 949
 950
 951
 952
 953
 954
 955
 956
 957
 958
 959
 960
 961
 962
 963
 964
 965
 966
 967
 968
 969
 970
 971
 972
 973
 974
 975
 976
 977
 978
 979
 980
 981
 982
 983
 984
 985
 986
 987
 988
 989
 990
 991
 992
 993
 994
 995
 996
 997
 998
 999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
2552
2553
2554
2555
2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
2595
2596
2597
2598
2599
2600
2601
2602
2603
2604
2605
2606
2607
2608
2609
2610
2611
2612
2613
2614
2615
2616
2617
2618
2619
2620
2621
2622
2623
2624
2625
2626
2627
2628
2629
2630
2631
2632
2633
2634
2635
2636
2637
2638
2639
2640
2641
2642
2643
2644
2645
2646
2647
2648
2649
2650
2651
2652
2653
2654
2655
2656
2657
2658
2659
2660
2661
2662
2663
2664
2665
2666
2667
2668
2669
2670
2671
2672
2673
2674
2675
2676
2677
2678
2679
2680
2681
2682
2683
2684
2685
2686
2687
2688
2689
2690
2691
2692
2693
2694
2695
2696
2697
2698
2699
2700
2701
2702
2703
2704
2705
2706
2707
2708
2709
2710
2711
2712
2713
2714
2715
2716
2717
2718
2719
2720
2721
2722
2723
2724
2725
2726
2727
2728
2729
2730
2731
2732
2733
2734
2735
2736
2737
2738
2739
2740
2741
2742
2743
2744
2745
2746
2747
2748
2749
2750
2751
2752
2753
2754
2755
2756
2757
2758
2759
2760
2761
2762
2763
2764
2765
2766
2767
2768
2769
2770
2771
2772
2773
2774
2775
2776
2777
2778
2779
2780
2781
2782
2783
2784
2785
2786
2787
2788
2789
2790
2791
2792
2793
2794
2795
2796
2797
2798
2799
2800
2801
2802
2803
2804
2805
2806
2807
2808
2809
2810
2811
2812
2813
2814
2815
2816
2817
2818
2819
2820
2821
2822
2823
2824
2825
2826
2827
2828
2829
2830
2831
2832
2833
2834
2835
2836
2837
2838
2839
2840
2841
2842
2843
2844
2845
2846
2847
2848
2849
2850
2851
2852
2853
2854
2855
2856
2857
2858
2859
2860
2861
2862
2863
2864
2865
2866
2867
2868
2869
2870
2871
2872
2873
2874
2875
2876
2877
2878
2879
2880
2881
2882
2883
2884
2885
2886
2887
2888
2889
2890
2891
2892
2893
2894
2895
2896
2897
2898
2899
2900
2901
2902
2903
2904
2905
2906
2907
2908
2909
2910
2911
2912
2913
2914
2915
2916
2917
2918
2919
2920
2921
2922
2923
2924
2925
2926
2927
2928
2929
2930
2931
2932
2933
2934
2935
2936
2937
2938
2939
2940
2941
2942
2943
2944
2945
2946
2947
2948
2949
2950
2951
2952
2953
2954
2955
2956
2957
2958
2959
2960
2961
2962
2963
2964
2965
2966
2967
2968
2969
2970
2971
2972
2973
2974
2975
2976
2977
2978
2979
2980
2981
2982
2983
2984
2985
2986
2987
2988
2989
2990
2991
2992
2993
2994
2995
2996
2997
2998
2999
3000
3001
3002
3003
3004
3005
3006
3007
3008
3009
3010
3011
3012
3013
3014
3015
3016
3017
3018
3019
3020
3021
3022
3023
3024
3025
3026
3027
3028
3029
3030
3031
3032
3033
3034
3035
3036
3037
3038
3039
3040
3041
3042
3043
3044
3045
3046
3047
3048
3049
3050
3051
3052
3053
3054
3055
3056
3057
3058
3059
3060
3061
3062
3063
3064
3065
3066
3067
3068
3069
3070
3071
3072
3073
3074
3075
3076
3077
3078
3079
3080
3081
3082
3083
3084
3085
3086
3087
3088
3089
3090
3091
3092
3093
3094
3095
3096
3097
3098
3099
3100
3101
3102
3103
3104
3105
3106
3107
3108
3109
3110
3111
3112
3113
3114
3115
3116
3117
3118
3119
3120
3121
3122
3123
3124
3125
3126
3127
3128
3129
3130
3131
3132
3133
3134
3135
3136
3137
3138
3139
3140
3141
3142
3143
3144
3145
3146
3147
3148
3149
3150
3151
3152
3153
3154
3155
3156
3157
3158
3159
3160
3161
3162
3163
3164
3165
3166
3167
3168
3169
3170
3171
3172
3173
3174
3175
3176
3177
3178
3179
3180
3181
3182
3183
3184
3185
3186
3187
3188
3189
3190
3191
3192
3193
3194
3195
3196
3197
3198
3199
3200
3201
3202
3203
3204
3205
3206
3207
3208
3209
3210
3211
3212
3213
3214
3215
3216
3217
3218
3219
3220
3221
3222
3223
3224
3225
3226
3227
3228
3229
3230
3231
3232
3233
3234
3235
3236
3237
3238
3239
3240
3241
3242
3243
3244
3245
3246
3247
3248
3249
3250
3251
3252
3253
3254
3255
3256
3257
3258
3259
3260
3261
3262
3263
3264
3265
3266
3267
3268
3269
3270
3271
3272
3273
3274
3275
3276
3277
3278
3279
3280
3281
3282
3283
3284
3285
3286
3287
3288
3289
3290
3291
3292
3293
3294
3295
3296
3297
3298
3299
3300
3301
3302
3303
3304
3305
3306
3307
3308
3309
3310
3311
3312
3313
3314
3315
3316
3317
3318
3319
3320
3321
3322
3323
3324
3325
3326
3327
3328
3329
3330
3331
3332
3333
3334
3335
3336
3337
3338
3339
3340
3341
3342
3343
3344
3345
3346
3347
3348
3349
3350
3351
3352
3353
3354
3355
3356
3357
3358
3359
3360
3361
3362
3363
3364
3365
3366
3367
3368
3369
3370
3371
3372
3373
3374
3375
3376
3377
3378
3379
3380
3381
3382
3383
3384
3385
3386
3387
3388
3389
3390
3391
3392
3393
3394
3395
3396
3397
3398
3399
3400
3401
3402
3403
3404
3405
3406
3407
3408
3409
3410
3411
3412
3413
3414
3415
3416
3417
3418
3419
3420
3421
3422
3423
3424
3425
3426
3427
3428
3429
3430
3431
3432
3433
3434
3435
3436
3437
3438
3439
3440
3441
3442
3443
3444
3445
3446
3447
3448
3449
3450
3451
3452
3453
3454
3455
3456
3457
3458
3459
3460
3461
3462
3463
3464
3465
3466
3467
3468
3469
3470
3471
3472
3473
3474
3475
3476
3477
3478
3479
3480
3481
3482
3483
3484
3485
3486
3487
3488
3489
3490
3491
3492
3493
3494
3495
3496
3497
3498
3499
3500
3501
3502
3503
3504
3505
3506
3507
3508
3509
3510
3511
3512
3513
3514
3515
3516
3517
3518
3519
3520
3521
3522
3523
3524
3525
3526
3527
3528
3529
3530
3531
3532
3533
3534
3535
3536
3537
3538
3539
3540
3541
3542
3543
3544
3545
3546
3547
3548
3549
3550
3551
3552
3553
3554
3555
3556
3557
3558
3559
3560
3561
3562
3563
3564
3565
3566
3567
3568
3569
3570
3571
3572
3573
3574
3575
3576
3577
3578
3579
3580
3581
3582
3583
3584
3585
3586
3587
3588
3589
3590
3591
3592
3593
3594
3595
3596
3597
3598
3599
3600
3601
3602
3603
3604
3605
3606
3607
3608
3609
3610
3611
3612
3613
3614
3615
3616
3617
3618
3619
3620
3621
3622
3623
3624
3625
3626
3627
3628
3629
3630
3631
3632
3633
3634
3635
3636
3637
3638
3639
3640
3641
3642
3643
3644
3645
3646
3647
3648
3649
3650
3651
3652
3653
3654
3655
3656
3657
3658
3659
3660
3661
3662
3663
3664
3665
3666
3667
3668
3669
3670
3671
3672
3673
3674
3675
3676
3677
3678
3679
3680
3681
3682
3683
3684
3685
3686
3687
3688
3689
3690
3691
3692
3693
3694
3695
3696
3697
3698
3699
3700
3701
3702
3703
3704
3705
3706
3707
3708
3709
3710
3711
3712
3713
3714
3715
3716
3717
3718
3719
3720
3721
3722
3723
3724
3725
3726
3727
3728
3729
3730
3731
3732
3733
3734
3735
3736
3737
3738
3739
3740
3741
3742
3743
3744
3745
3746
3747
3748
3749
3750
3751
3752
3753
3754
3755
3756
3757
3758
3759
3760
3761
3762
3763
3764
3765
3766
3767
3768
3769
3770
3771
3772
3773
3774
3775
3776
3777
3778
3779
3780
3781
3782
3783
3784
3785
3786
3787
3788
3789
3790
3791
3792
3793
3794
3795
3796
3797
3798
3799
3800
3801
3802
3803
3804
3805
3806
3807
3808
3809
3810
3811
3812
3813
3814
3815
3816
3817
3818
3819
3820
3821
3822
3823
3824
3825
3826
3827
3828
3829
3830
3831
3832
3833
3834
3835
3836
3837
3838
3839
3840
3841
3842
3843
3844
3845
3846
3847
3848
3849
3850
3851
3852
3853
3854
3855
3856
3857
3858
3859
3860
3861
3862
3863
3864
3865
3866
3867
3868
3869
3870
3871
3872
3873
3874
3875
3876
3877
3878
3879
3880
3881
3882
3883
3884
3885
3886
3887
3888
3889
3890
3891
3892
3893
3894
3895
3896
3897
3898
3899
3900
3901
3902
3903
3904
3905
3906
3907
3908
3909
3910
3911
3912
3913
3914
3915
3916
3917
3918
3919
3920
3921
3922
3923
3924
3925
3926
3927
3928
3929
3930
3931
3932
3933
3934
3935
3936
3937
3938
3939
3940
3941
3942
3943
3944
3945
3946
3947
3948
3949
3950
3951
3952
3953
3954
3955
3956
3957
3958
3959
3960
3961
3962
3963
3964
3965
3966
3967
3968
3969
3970
3971
3972
3973
3974
3975
3976
3977
3978
3979
3980
3981
3982
3983
3984
3985
3986
3987
3988
3989
3990
3991
3992
3993
3994
3995
3996
3997
3998
3999
4000
4001
4002
4003
4004
4005
4006
4007
4008
4009
4010
4011
4012
4013
4014
4015
4016
4017
4018
4019
4020
4021
4022
4023
4024
4025
4026
4027
4028
4029
4030
4031
4032
4033
4034
4035
4036
4037
4038
4039
4040
4041
4042
4043
4044
4045
4046
4047
4048
4049
4050
4051
4052
4053
4054
4055
4056
4057
4058
4059
4060
4061
4062
4063
4064
4065
4066
4067
4068
4069
4070
4071
4072
4073
4074
4075
4076
4077
4078
4079
4080
4081
4082
4083
4084
4085
4086
4087
4088
4089
4090
4091
4092
4093
4094
4095
4096
4097
4098
4099
4100
4101
4102
4103
4104
4105
4106
4107
4108
4109
4110
4111
4112
4113
4114
4115
4116
4117
4118
4119
4120
4121
4122
4123
4124
4125
4126
4127
4128
4129
4130
4131
4132
4133
4134
4135
4136
4137
4138
4139
4140
4141
4142
4143
4144
4145
4146
4147
4148
4149
4150
4151
4152
4153
4154
4155
4156
4157
4158
4159
4160
4161
4162
4163
4164
4165
4166
4167
4168
4169
4170
4171
4172
4173
4174
4175
4176
4177
4178
4179
4180
4181
4182
4183
4184
4185
4186
4187
4188
4189
4190
4191
4192
4193
4194
4195
4196
4197
4198
4199
4200
4201
4202
4203
4204
4205
4206
4207
4208
4209
4210
4211
4212
4213
4214
4215
4216
4217
4218
4219
4220
4221
4222
4223
4224
4225
4226
4227
4228
4229
4230
4231
4232
4233
4234
4235
4236
4237
4238
4239
4240
4241
4242
4243
4244
4245
4246
4247
4248
4249
4250
4251
4252
4253
4254
4255
4256
4257
4258
4259
4260
4261
4262
4263
4264
4265
4266
4267
4268
4269
4270
4271
4272
4273
4274
4275
4276
4277
4278
4279
4280
4281
4282
4283
4284
4285
4286
4287
4288
4289
4290
4291
4292
4293
4294
4295
4296
4297
4298
4299
4300
4301
4302
4303
4304
4305
4306
4307
4308
4309
4310
4311
4312
4313
4314
4315
4316
4317
4318
4319
4320
4321
4322
4323
4324
4325
4326
4327
4328
4329
4330
4331
4332
4333
4334
4335
4336
4337
4338
4339
4340
4341
4342
4343
4344
4345
4346
4347
4348
4349
4350
4351
4352
4353
4354
4355
4356
4357
4358
4359
4360
4361
4362
4363
4364
4365
4366
4367
4368
4369
4370
4371
4372
4373
4374
4375
4376
4377
4378
4379
4380
4381
4382
4383
4384
4385
4386
4387
4388
4389
4390
4391
4392
4393
4394
4395
4396
4397
4398
4399
4400
4401
4402
4403
4404
4405
4406
4407
4408
4409
4410
4411
4412
4413
4414
4415
4416
4417
4418
4419
4420
4421
4422
4423
4424
4425
4426
4427
4428
4429
4430
4431
4432
4433
4434
4435
4436
4437
4438
4439
4440
4441
4442
4443
4444
4445
4446
4447
4448
4449
4450
4451
4452
4453
4454
4455
4456
4457
4458
4459
4460
4461
4462
4463
4464
4465
4466
4467
4468
4469
4470
4471
4472
4473
4474
4475
4476
4477
4478
4479
4480
4481
4482
4483
4484
4485
4486
4487
4488
4489
4490
4491
4492
4493
4494
4495
4496
4497
4498
4499
4500
4501
4502
4503
4504
4505
4506
4507
4508
4509
4510
4511
4512
4513
4514
4515
4516
4517
4518
4519
4520
4521
4522
4523
4524
4525
4526
4527
4528
4529
4530
4531
4532
4533
4534
4535
4536
4537
4538
4539
4540
4541
4542
4543
4544
4545
4546
4547
4548
4549
4550
4551
4552
4553
4554
4555
4556
4557
4558
4559
4560
4561
4562
4563
4564
4565
4566
4567
4568
4569
4570
4571
4572
4573
4574
4575
4576
4577
4578
4579
4580
4581
4582
4583
4584
4585
4586
4587
4588
4589
4590
4591
4592
4593
4594
4595
4596
4597
4598
4599
4600
4601
4602
4603
4604
4605
4606
4607
4608
4609
4610
4611
4612
4613
4614
4615
4616
4617
4618
4619
4620
4621
4622
4623
4624
4625
4626
4627
4628
4629
4630
4631
4632
4633
4634
4635
4636
4637
4638
4639
4640
4641
4642
4643
4644
4645
4646
4647
4648
4649
4650
4651
4652
4653
4654
4655
4656
4657
4658
4659
4660
4661
4662
4663
4664
4665
4666
4667
4668
4669
4670
4671
4672
4673
4674
4675
4676
4677
4678
4679
4680
4681
4682
4683
4684
4685
4686
4687
4688
4689
4690
4691
4692
4693
4694
4695
4696
4697
4698
4699
4700
4701
4702
4703
4704
4705
4706
4707
4708
4709
4710
4711
4712
4713
4714
4715
4716
4717
4718
4719
4720
4721
4722
4723
4724
4725
4726
4727
4728
4729
4730
4731
4732
4733
4734
4735
4736
4737
4738
4739
4740
4741
4742
4743
4744
4745
4746
4747
4748
4749
4750
4751
4752
4753
4754
4755
4756
4757
4758
4759
4760
4761
4762
4763
4764
4765
4766
4767
4768
4769
4770
4771
4772
4773
4774
4775
4776
4777
4778
4779
4780
4781
4782
4783
4784
4785
4786
4787
4788
4789
4790
4791
4792
4793
4794
4795
4796
4797
4798
4799
4800
4801
4802
4803
4804
4805
4806
4807
4808
4809
4810
4811
4812
4813
4814
4815
4816
4817
4818
4819
4820
4821
4822
4823
4824
4825
4826
4827
4828
4829
4830
4831
4832
4833
4834
4835
4836
4837
4838
4839
4840
4841
4842
4843
4844
4845
4846
4847
4848
4849
4850
4851
4852
4853
4854
4855
4856
4857
4858
4859
4860
4861
4862
4863
4864
4865
4866
4867
4868
4869
4870
4871
4872
4873
4874
4875
4876
4877
4878
4879
4880
4881
4882
4883
4884
4885
4886
4887
4888
4889
4890
4891
4892
4893
4894
4895
4896
4897
4898
4899
4900
4901
4902
4903
4904
4905
4906
4907
4908
4909
4910
4911
4912
4913
4914
4915
4916
4917
4918
4919
4920
4921
4922
4923
4924
4925
4926
4927
4928
4929
4930
4931
4932
4933
4934
4935
4936
4937
4938
4939
4940
4941
4942
4943
4944
4945
4946
4947
4948
4949
4950
4951
4952
4953
4954
4955
4956
4957
4958
4959
4960
4961
4962
4963
4964
4965
4966
4967
4968
4969
4970
4971
4972
4973
4974
4975
4976
4977
4978
4979
4980
4981
4982
4983
4984
4985
4986
4987
4988
4989
4990
4991
4992
4993
4994
4995
4996
4997
4998
4999
5000
5001
5002
5003
5004
5005
5006
5007
5008
5009
5010
5011
5012
5013
5014
5015
5016
5017
5018
5019
5020
5021
5022
5023
5024
5025
5026
5027
5028
5029
5030
5031
5032
5033
5034
5035
5036
5037
5038
5039
5040
5041
5042
5043
5044
5045
5046
5047
5048
5049
5050
5051
5052
5053
5054
5055
5056
5057
5058
5059
5060
5061
5062
5063
5064
5065
5066
5067
5068
5069
5070
5071
5072
5073
5074
5075
5076
5077
5078
5079
5080
5081
5082
5083
5084
5085
5086
5087
5088
5089
5090
5091
5092
5093
5094
5095
5096
5097
5098
5099
5100
5101
5102
5103
5104
5105
5106
5107
5108
5109
5110
5111
5112
5113
5114
5115
5116
5117
5118
5119
5120
5121
5122
5123
5124
5125
5126
5127
5128
5129
5130
5131
5132
5133
5134
5135
5136
5137
5138
5139
5140
5141
5142
5143
5144
5145
5146
5147
5148
5149
5150
5151
5152
5153
5154
5155
5156
5157
5158
5159
5160
5161
5162
5163
5164
5165
5166
5167
5168
5169
5170
5171
5172
5173
5174
5175
5176
5177
5178
5179
5180
5181
5182
5183
5184
5185
5186
5187
5188
5189
1
00:00:00,000 --> 00:00:00,500

2
00:00:00,500 --> 00:00:05,120
[Daqq ta mużika]

3
00:00:05,120 --> 00:00:12,026

4
00:00:12,026 --> 00:00:12,900
SPEAKER 1: Kull dritt.

5
00:00:12,900 --> 00:00:14,600
Kulħadd merħba lura għat-taqsima.

6
00:00:14,600 --> 00:00:18,660
Nispera li intom kollha huma b'suċċess
rkuprati minn kwizz tiegħek

7
00:00:18,660 --> 00:00:19,510
mill-aħħar ġimgħa.

8
00:00:19,510 --> 00:00:22,564
Naf huwa ftit crazy f'ħinijiet.

9
00:00:22,564 --> 00:00:25,230
Kif I kien qal qabel, jekk int
fi ħdan id-devjazzjoni standard,

10
00:00:25,230 --> 00:00:28,188
ma verament tinkwieta dwar dan, speċjalment
għal taqsima inqas komdi.

11
00:00:28,188 --> 00:00:30,230
Dan huwa madwar fejn inti għandek tkun.

12
00:00:30,230 --> 00:00:32,850
>> Jekk inti għamilt kbir, imbagħad biża.

13
00:00:32,850 --> 00:00:33,650
Kudos lilek.

14
00:00:33,650 --> 00:00:36,149
U jekk inti tħoss bħal għandek bżonn
ftit aktar għajnuna, jekk jogħġbok

15
00:00:36,149 --> 00:00:38,140
tħossok liberu li jilħqu
out għal xi TFS.

16
00:00:38,140 --> 00:00:40,030
Aħna lkoll hawn biex jgħinu.

17
00:00:40,030 --> 00:00:40,960
>> C'est pourquoi aħna jgħallmu.

18
00:00:40,960 --> 00:00:44,550
C'est pourquoi jien hawn kull Tnejn għalik
guys u fl-uffiċċju sigħat nhar ta 'Ħamis.

19
00:00:44,550 --> 00:00:48,130
Allura jekk jogħġbok tħossok liberu li let me know
jekk int inkwetat dwar xi ħaġa

20
00:00:48,130 --> 00:00:52,450
jew jekk hemm xi ħaġa fuq l-kwizz
li youd verament tixtieq tindirizza.

21
00:00:52,450 --> 00:00:56,940
>> Għalhekk l-aġenda għal-lum huwa
kollha dwar strutturi ta 'dejta.

22
00:00:56,940 --> 00:01:01,520
Uħud minn dawn huma biss ser tkun biss
biex inti tikseb familiarized ma 'dawn.

23
00:01:01,520 --> 00:01:04,870
Inti tista 'ma qatt jimplimentaw
minnhom f'din il-klassi.

24
00:01:04,870 --> 00:01:08,690
Xi wħud minnhom inti se,
bħal per pset speller tiegħek.

25
00:01:08,690 --> 00:01:11,380
>> Inti ser ikollok l-għażla tiegħek
bejn tabelli hash u tipprova.

26
00:01:11,380 --> 00:01:13,680
Allura aħna ser definittivament jkunu għaddejjin fuq dawk.

27
00:01:13,680 --> 00:01:18,690
Li għaddej biex tkun definittivament aktar ta 'tip
ta 'sezzjoni livellata għoli llum, għalkemm,

28
00:01:18,690 --> 00:01:22,630
minħabba li hemm ħafna minnhom, u jekk
aħna marru fis-dettalji ta 'implimentazzjoni

29
00:01:22,630 --> 00:01:26,490
fuq kollha ta 'dawn, aħna se le
anki nikseb permezz ta 'listi marbuta

30
00:01:26,490 --> 00:01:28,520
u forsi xi ftit ta 'tabelli hash.

31
00:01:28,520 --> 00:01:31,200
>> Allura jkollhom miegħi.

32
00:01:31,200 --> 00:01:33,530
Aħna mhux se tkun qed twettaq
daqshekk kodifikazzjoni dan iż-żmien.

33
00:01:33,530 --> 00:01:36,870
Jekk għandek xi mistoqsijiet dwar dan
jew inti tixtieq li tara implimentata

34
00:01:36,870 --> 00:01:39,260
jew jippruvaw hija għalik innifsek,
I definitely jirrakkomandaw

35
00:01:39,260 --> 00:01:44,250
ser study.cs50.net, li
għandha eżempji ta 'dawn kollha.

36
00:01:44,250 --> 00:01:46,400
Hija ser ikollhom powerpoints tiegħi
man-noti li aħna

37
00:01:46,400 --> 00:01:50,860
għandhom tendenza li jużaw kif ukoll xi programmazzjoni
eżerċizzji, speċjalment għall-affarijiet

38
00:01:50,860 --> 00:01:55,250
bħal listi konnessi u binarja
stacks siġar u cues.

39
00:01:55,250 --> 00:01:59,590
Allura ftit aktar livell għoli, li
jista 'jkun sbieħ għall inti guys.

40
00:01:59,590 --> 00:02:01,320
>> Allura ma 'dan, aħna ser tibda.

41
00:02:01,320 --> 00:02:03,060
U wkoll, kwizzijiet yes--.

42
00:02:03,060 --> 00:02:06,550
Naħseb li ħafna minnkom li huma fil-
taqsima tiegħi jkollhom kwizzijiet tiegħek,

43
00:02:06,550 --> 00:02:12,060
iżda xi ħadd jiġi fl jew xi raġuni inti
ma, dawn qed dritt hawn fl-quddiem.

44
00:02:12,060 --> 00:02:12,740
>> Hekk listi marbuta.

45
00:02:12,740 --> 00:02:15,650
Naf li dan it-tip ta 'tmur
li back qabel kwizz tiegħek.

46
00:02:15,650 --> 00:02:17,940
Dan kien l-ġimgħa qabel
li aħna tgħallmu dwar dan.

47
00:02:17,940 --> 00:02:21,040
Iżda f'dan il-każ, aħna ser biss
jmorru ftit aktar fil-fond.

48
00:02:21,040 --> 00:02:25,900
>> Allura għaliex jista nagħżlu
marbut lista fuq firxa?

49
00:02:25,900 --> 00:02:27,130
Dak li jiddistingwihom minnhom?

50
00:02:27,130 --> 00:02:27,630
Iva?

51
00:02:27,630 --> 00:02:30,464
>> UDJENZA: Inti tista 'tespandi a marbut
lista versus daqs fiss ta 'firxa.

52
00:02:30,464 --> 00:02:31,171
SPEAKER 1: Dritt.

53
00:02:31,171 --> 00:02:33,970
Firxa ffissat daqs billi
lista marbuta għandu daqs varjabbli.

54
00:02:33,970 --> 00:02:36,970
Hekk jekk ma nafux kif
kemm aħna tixtieq li taħżen,

55
00:02:36,970 --> 00:02:39,880
lista marbuta jagħtina kbir
mod biex tagħmel dan għaliex nistgħu biss

56
00:02:39,880 --> 00:02:43,730
żid fuq node ieħor u żid fuq
node u ieħor żid fuq node ieħor.

57
00:02:43,730 --> 00:02:45,750
Imma dak li jista 'jkun kompromess?

58
00:02:45,750 --> 00:02:49,521
Ħadd ma tiftakar il-kompromess
bejn arrays u listi marbuta?

59
00:02:49,521 --> 00:02:50,020
Mmhmm?

60
00:02:50,020 --> 00:02:51,460
>> UDJENZA: Inti għandek biex
jgħaddu-triq kollha

61
00:02:51,460 --> 00:02:53,738
permezz tal-lista marbuta
isibu element f'lista.

62
00:02:53,738 --> 00:02:55,570
Fil-firxa, inti tista
biss issib element.

63
00:02:55,570 --> 00:02:56,278
>> SPEAKER 1: Dritt.

64
00:02:56,278 --> 00:02:57,120
Allura ma arrays--

65
00:02:57,120 --> 00:02:58,500
>> UDJENZA: [inaudible].

66
00:02:58,500 --> 00:03:01,090
>> SPEAKER 1: Bil arrays, għandna
dak li sejjaħ aċċess bl-addoċċ.

67
00:03:01,090 --> 00:03:04,820
Ifisser li jekk irridu dak li huwa
qatt il-ħames punt ta 'lista

68
00:03:04,820 --> 00:03:07,230
jew il-ħames punt ta 'tagħna
firxa, nistgħu biss grab dan.

69
00:03:07,230 --> 00:03:10,440
Jekk huwa lista marbuta, għandna
li jtenni permezz, id-dritt?

70
00:03:10,440 --> 00:03:14,020
Allura aċċess element fil
firxa huwa żmien kostanti,

71
00:03:14,020 --> 00:03:19,530
billi ma 'lista marbuta li kieku
jkun x'aktarx ħin lineari għaliex forsi

72
00:03:19,530 --> 00:03:21,370
element tagħna huwa l-triq kollha fl-aħħar.

73
00:03:21,370 --> 00:03:23,446
Irridu tfittxija permezz kollox.

74
00:03:23,446 --> 00:03:25,320
Allura ma 'dawn id-data kollha
istrutturi aħna qed tmur

75
00:03:25,320 --> 00:03:29,330
li tkun infiq ftit aktar ħin fuq,
liema huma l-pluses u negattivi.

76
00:03:29,330 --> 00:03:31,480
Meta tista irridu
tuża wieħed fuq l-ieħor?

77
00:03:31,480 --> 00:03:34,970
U dak l-tip ta 'l-
ħaġa akbar għal take away.

78
00:03:34,970 --> 00:03:40,140
>> Allura għandna hawnhekk l-
definizzjoni ta 'node.

79
00:03:40,140 --> 00:03:43,040
Huwa simili element wieħed fl
lista marbuta tagħna, id-dritt?

80
00:03:43,040 --> 00:03:46,180
Allura aħna qed kollha familjari
mal structs typedef tagħna,

81
00:03:46,180 --> 00:03:47,980
li aħna marru fuq fl-analiżi aħħar darba.

82
00:03:47,980 --> 00:03:53,180
Kien bażikament biss joħolqu
tip ieħor data li nistgħu jużaw.

83
00:03:53,180 --> 00:03:57,930
>> U f'dan il-każ, huwa xi node
li ser ikollu xi numru sħiħ fil.

84
00:03:57,930 --> 00:04:00,210
U allura x'inhu l-tieni parti hawn?

85
00:04:00,210 --> 00:04:03,192

86
00:04:03,192 --> 00:04:05,677
Xi ħadd?

87
00:04:05,677 --> 00:04:06,680
>> UDJENZA: [inaudible].

88
00:04:06,680 --> 00:04:07,020
>> SPEAKER 1: Yeah.

89
00:04:07,020 --> 00:04:08,400
Huwa pointer għall-node li jmiss.

90
00:04:08,400 --> 00:04:12,610
Allura dan għandu attwalment ikun up here.

91
00:04:12,610 --> 00:04:18,790
Din hija pointer tat-tip
node għall-ħaġa li jmiss.

92
00:04:18,790 --> 00:04:22,410
U dan huwa dak li
jinkludi node tagħna.

93
00:04:22,410 --> 00:04:24,060
Kessaħ.

94
00:04:24,060 --> 00:04:29,390
>> Kull dritt, hekk bil-tfittxija, kif konna
biss qal qabel l-idejn, jekk int

95
00:04:29,390 --> 00:04:31,840
ser tfittex permezz,
inti għandek attwalment jtenni

96
00:04:31,840 --> 00:04:33,660
permezz lista marbuta tiegħek.

97
00:04:33,660 --> 00:04:38,530
Hekk jekk aħna qed tfittex għan-numru
9, aħna se tibda fil-kap tagħna

98
00:04:38,530 --> 00:04:41,520
u li l-punti magħna fil-bidu
tal-lista marbuta tagħna, id-dritt?

99
00:04:41,520 --> 00:04:44,600
U aħna ngħidu, OK, ma dan
node fih in-numru 9?

100
00:04:44,600 --> 00:04:45,690
No?

101
00:04:45,690 --> 00:04:47,500
>> Kull dritt, mur l-wieħed li jmiss.

102
00:04:47,500 --> 00:04:48,312
Segwi dan.

103
00:04:48,312 --> 00:04:49,520
Ma fiha n-numru 9?

104
00:04:49,520 --> 00:04:50,570
No

105
00:04:50,570 --> 00:04:51,550
Segwi l-wieħed li jmiss.

106
00:04:51,550 --> 00:04:55,490
>> Allura aħna għandna biex effettivament jtenni
permezz lista marbuta tagħna.

107
00:04:55,490 --> 00:05:00,070
Ma nistgħux sempliċement tmur direttament lejn fejn 9 hu.

108
00:05:00,070 --> 00:05:05,860
U jekk inti guys fil-fatt tixtieq li
tara xi psewdo-kodiċi up hemm.

109
00:05:05,860 --> 00:05:10,420
Għandna xi funzjoni ta 'tfittxija hawn
li jieħu in-- dak li ma jieħdu fil-?

110
00:05:10,420 --> 00:05:13,110

111
00:05:13,110 --> 00:05:14,320
What do you think?

112
00:05:14,320 --> 00:05:15,960
Wieħed daqshekk faċli.

113
00:05:15,960 --> 00:05:17,784
X'inhu dan?

114
00:05:17,784 --> 00:05:18,700
UDJENZA: [inaudible].

115
00:05:18,700 --> 00:05:20,366
SPEAKER 1: L-għadd aħna qed tfittex.

116
00:05:20,366 --> 00:05:20,980
Dritt?

117
00:05:20,980 --> 00:05:22,875
U dak li dan jikkorrispondi għall?

118
00:05:22,875 --> 00:05:25,020
Huwa pointer li?

119
00:05:25,020 --> 00:05:26,000
>> UDJENZA: A node.

120
00:05:26,000 --> 00:05:28,980
>> SPEAKER 1: A node għal-lista
li aħna qed tħares lejn, id-dritt?

121
00:05:28,980 --> 00:05:33,700
Allura aħna għandna xi glandoli huma pointer hawn.

122
00:05:33,700 --> 00:05:37,240
Dan huwa punt li għaddej biex
attwalment jtenni permezz lista tagħna.

123
00:05:37,240 --> 00:05:39,630
Waqqafna din ugwali għall-lista
għaliex dan huwa biss

124
00:05:39,630 --> 00:05:44,380
dan ikun iffissat ugwali għall-
bidu tal-lista marbuta tagħna.

125
00:05:44,380 --> 00:05:50,660
>> U filwaqt li huwa ma NULL, filwaqt li
aħna xorta jkollhom affarijiet fil-lista tagħna,

126
00:05:50,660 --> 00:05:55,580
tikkontrolla biex tara jekk dik node għandha
in-numru aħna qed tfittex.

127
00:05:55,580 --> 00:05:57,740
Ritorn vera.

128
00:05:57,740 --> 00:06:01,070
Inkella, jaġġornah, id-dritt?

129
00:06:01,070 --> 00:06:04,870
>> Jekk huwa NULL, aħna ħruġ tagħna
filwaqt loop u r-ritorn foloz

130
00:06:04,870 --> 00:06:08,340
għaliex dan ifisser li aħna ma sabu dan.

131
00:06:08,340 --> 00:06:11,048
Does kulħadd nikseb kif din taħdem?

132
00:06:11,048 --> 00:06:11,548
OK.

133
00:06:11,548 --> 00:06:14,940

134
00:06:14,940 --> 00:06:20,260
>> Allura ma inserzjoni, inti
għandhom tliet modi differenti.

135
00:06:20,260 --> 00:06:25,250
Tista prepend, inti tista 'tehmeż
u inti tista 'daħħal fis assortiti.

136
00:06:25,250 --> 00:06:28,215
F'dan il-każ, aħna qed
se tagħmel prepend.

137
00:06:28,215 --> 00:06:33,380
Ħadd ma jaf kif dawk
tliet każijiet jistgħu jvarjaw?

138
00:06:33,380 --> 00:06:36,920
>> Allura prepend ifisser li inti tpoġġi
huwa fuq quddiem tal-lista tiegħek.

139
00:06:36,920 --> 00:06:39,770
Allura dan ikun ifisser li l-ebda kwistjoni
dak node tiegħek huwa, irrelevanti

140
00:06:39,770 --> 00:06:43,160
dak il-valur huwa, int ser
li tqiegħed lilha dritt hawn fuq quddiem, OK?

141
00:06:43,160 --> 00:06:45,160
Li għaddej biex tkun l-ewwel
element fil-lista tiegħek.

142
00:06:45,160 --> 00:06:49,510
>> Jekk inti tehmeż dan, li għaddej
biex tmur fil-dahar tal-lista tiegħek.

143
00:06:49,510 --> 00:06:54,010
U daħħal fis assortiti ifisser li int
ser jitqiegħdu fil-fatt fil-post

144
00:06:54,010 --> 00:06:57,700
fejn iżomm lista marbuta tiegħek magħżula.

145
00:06:57,700 --> 00:07:00,810
Għal darb'oħra, kif tuża
dawn u meta tuża

146
00:07:00,810 --> 00:07:02,530
minnhom se jvarjaw skond il-każ tiegħek.

147
00:07:02,530 --> 00:07:05,834

148
00:07:05,834 --> 00:07:07,750
Jekk ma bżonn
jiġu magħżula, prepend tendenza

149
00:07:07,750 --> 00:07:10,460
li jkun dak li ħafna nies
jużaw għaliex inti ma

150
00:07:10,460 --> 00:07:15,680
għandhom jgħaddu l-lista sħiħa
biex isibu l-aħħar iżżidhiex fuq, id-dritt?

151
00:07:15,680 --> 00:07:17,720
Inti tista 'biss stick dan id-dritt fil-.

152
00:07:17,720 --> 00:07:21,930
>> Allura aħna se jmorru permezz ta '
inserzjoni 1 id-dritt issa.

153
00:07:21,930 --> 00:07:26,360
Ħaġa Allura wieħed li jien ser
jirrakkomanda ħafna fuq dan pset

154
00:07:26,360 --> 00:07:29,820
huwa li tiġbed l-affarijiet out, bħal dejjem.

155
00:07:29,820 --> 00:07:35,130
Huwa importanti ħafna li inti aġġornament
pointers tiegħek fl-ordni korretta

156
00:07:35,130 --> 00:07:38,620
għaliex jekk inti taġġornahom
ftit out of order,

157
00:07:38,620 --> 00:07:42,210
int ser jispiċċaw
jitilfu partijiet tal-lista tiegħek.

158
00:07:42,210 --> 00:07:49,680
>> Hekk per eżempju, f'dan il-każ, aħna qed
javżak-ras għal ftit punt 1.

159
00:07:49,680 --> 00:07:56,070
Jekk aħna biss tagħmel dan
mingħajr iffrankar dan 1,

160
00:07:56,070 --> 00:07:58,570
aħna għandna ebda idea dak li
1 għandu jindika li issa

161
00:07:58,570 --> 00:08:02,490
għaliex aħna tilfu dak
il-kap indikat.

162
00:08:02,490 --> 00:08:05,530
Allura ħaġa waħda li tiftakar
meta int tagħmel prepend

163
00:08:05,530 --> 00:08:09,630
hu li jsalva dak li l-
punti Head sa l-ewwel,

164
00:08:09,630 --> 00:08:15,210
imbagħad jassenja mill-ġdid, u mbagħad taġġorna
dak node ġdid tiegħek għandu jindika.

165
00:08:15,210 --> 00:08:20,870

166
00:08:20,870 --> 00:08:22,560
F'dan il-każ, dan huwa mod wieħed biex tagħmel dan.

167
00:08:22,560 --> 00:08:25,440
>> Hekk jekk aħna kienu għamlu dan il-mod
fejn aħna biss assenjati mill-ġdid tar-ras,

168
00:08:25,440 --> 00:08:30,320
aħna jitilfu bażikament tagħna
lista sħiħa, id-dritt?

169
00:08:30,320 --> 00:08:38,000
Mod wieħed biex tagħmel dan huwa li jkollhom 1 punt li
jmiss, u mbagħad ikollhom punt ras għal 1.

170
00:08:38,000 --> 00:08:42,650
Jew inti tista 'tagħmel it-tip ta bħall-
ħażna temporanja, li jiena tkellem dwar.

171
00:08:42,650 --> 00:08:45,670
>> Iżda jassenjaw mill-ġdid tiegħek
pointers fl-ordni korretta

172
00:08:45,670 --> 00:08:48,750
se tkun ħafna, ħafna
importanti għal din pset.

173
00:08:48,750 --> 00:08:53,140
Inkella, int se jkollhom hash
mejda jew jipprova li jinsab biss se tkun

174
00:08:53,140 --> 00:08:56,014
parti biss tal-kliem li inti
tixtieq u mbagħad mmhmm you're--?

175
00:08:56,014 --> 00:08:58,930
UDJENZA: Liema kienet l-temporanja
Ħaġa ħażna inti kienu jitkellem dwar?

176
00:08:58,930 --> 00:09:00,305
SPEAKER 1: Il-ħażna temporanja.

177
00:09:00,305 --> 00:09:02,760
Allura bażikament ieħor
mod inti tista 'tagħmel dan

178
00:09:02,760 --> 00:09:07,650
huwa jaħżen il-kap ta 'xi ħaġa, bħal
jaħżnuh il-varjabbli temporanju.

179
00:09:07,650 --> 00:09:11,250
Tassenja din għal 1 u
imbagħad jaġġornaw 1 punt

180
00:09:11,250 --> 00:09:13,830
għal dak kollu ras użati għall-punt li.

181
00:09:13,830 --> 00:09:16,920
Dan il-mod huwa ovvjament
aktar eleganti għaliex inti

182
00:09:16,920 --> 00:09:20,770
m'għandhomx bżonn valur temporanju, iżda
ftit joffru mod ieħor biex tagħmel dan.

183
00:09:20,770 --> 00:09:23,999

184
00:09:23,999 --> 00:09:25,790
U għandna attwalment do jkollhom
xi kodiċi għal dan.

185
00:09:25,790 --> 00:09:28,080
Allura għal-lista marbuta, aħna
attwalment ikollhom xi kodiċi.

186
00:09:28,080 --> 00:09:31,930
Allura daħħal hawn, dan huwa prepending.

187
00:09:31,930 --> 00:09:34,290
Allura dan jidħol dan fil-ras.

188
00:09:34,290 --> 00:09:38,820
>> Allura l-ewwel ħaġa, għandek bżonn li
joħolqu node ġdid tiegħek, naturalment,

189
00:09:38,820 --> 00:09:40,790
u ċċekkja għall NULL.

190
00:09:40,790 --> 00:09:43,250
Dejjem tajjeb.

191
00:09:43,250 --> 00:09:47,840
U allura inti għandek bżonn biex tassenja l-valuri.

192
00:09:47,840 --> 00:09:51,260
Kull meta inti toħloq node ġdid, inti
ma jafux liema huwa tipponta lejn jmiss,

193
00:09:51,260 --> 00:09:54,560
sabiex inti tixtieq li initialize li NULL.

194
00:09:54,560 --> 00:09:58,760
Jekk ma jispiċċaw tipponta lejn xi ħaġa
inkella, jiġrilha riassenjata u huwa multa.

195
00:09:58,760 --> 00:10:00,740
Jekk huwa l-ewwel ħaġa
fil-lista, jeħtieġ

196
00:10:00,740 --> 00:10:04,270
għall-punt li NULL għaliex
dak l-aħħar tal-lista.

197
00:10:04,270 --> 00:10:12,410
>> Hekk allura li daħħalha, naraw hawnhekk aħna
jassenjaw il-valur li jmiss ta 'node tagħna

198
00:10:12,410 --> 00:10:17,380
li jkun x'ikun ras hija,
li huwa dak li kellna hawn.

199
00:10:17,380 --> 00:10:19,930
Dak hu li aħna biss għamlet.

200
00:10:19,930 --> 00:10:25,820
U allura aħna qed jassenjaw ras il-punt
biex node ġdid tagħna, għaliex ftakar,

201
00:10:25,820 --> 00:10:31,090
ġdid hija xi pointer għal node,
u dan huwa eżattament dak li ras hija.

202
00:10:31,090 --> 00:10:34,370
Dan huwa eżattament għaliex aħna
jkollhom din vleġġa accessor.

203
00:10:34,370 --> 00:10:37,030

204
00:10:37,030 --> 00:10:37,530
Kessaħ?

205
00:10:37,530 --> 00:10:38,130
Mmhmm?

206
00:10:38,130 --> 00:10:41,100
>> UDJENZA: Do irridu
initialize jmiss ġdid għall NULL ewwel,

207
00:10:41,100 --> 00:10:44,240
jew nistgħu sempliċement initialize dan li ras?

208
00:10:44,240 --> 00:10:48,210
>> SPEAKER 1: li jmiss New
jeħtieġ li jkun NULL biex tibda

209
00:10:48,210 --> 00:10:53,760
għaliex inti ma tafx
fejn huwa għaddej biex tkun.

210
00:10:53,760 --> 00:10:56,100
Ukoll, dan huwa tip ta '
bħad paradigma.

211
00:10:56,100 --> 00:10:59,900
Int tkun qed tissettja ugwali għal NULL biss li tagħmel
żgur li bażijiet kollha tiegħek huma koperti

212
00:10:59,900 --> 00:11:04,070
qabel ma tagħmel xi assenjar sabiex
int dejjem garantit li se

213
00:11:04,070 --> 00:11:08,880
tkun tipponta lejn valur speċifiku
versus bħal valur żibel.

214
00:11:08,880 --> 00:11:12,210
Minħabba, yeah, aħna tassenja
awtomatikament ġdid li jmiss,

215
00:11:12,210 --> 00:11:15,420
iżda huwa aktar biss bħal
prattika tajba li initialize dan

216
00:11:15,420 --> 00:11:19,270
b'dak il-mod u mbagħad jassenja mill-ġdid.

217
00:11:19,270 --> 00:11:23,420
>> OK, listi marbuta hekk doppjament issa.

218
00:11:23,420 --> 00:11:24,601
What do naħsbu?

219
00:11:24,601 --> 00:11:26,350
X'hemm differenti ma
listi marbuta doppjament?

220
00:11:26,350 --> 00:11:30,750

221
00:11:30,750 --> 00:11:34,300
>> Allura fil-listi marbuta tagħna, nistgħu
biss jimxu f'direzzjoni waħda, id-dritt?

222
00:11:34,300 --> 00:11:35,270
Aħna biss li jmiss.

223
00:11:35,270 --> 00:11:36,760
Nistgħu biss jimxu 'l quddiem.

224
00:11:36,760 --> 00:11:40,300
>> Ma 'lista marbuta doppjament,
nistgħu wkoll jimxu lura.

225
00:11:40,300 --> 00:11:44,810
Allura aħna għandna mhux biss il-
Numru li aħna tixtieq li taħżen,

226
00:11:44,810 --> 00:11:50,110
għandna fejn hija tirreferi għall jmiss
u fejn aħna biss ġew minn.

227
00:11:50,110 --> 00:11:52,865
Allura dan jippermetti
xi traversal aħjar.

228
00:11:52,865 --> 00:11:56,620

229
00:11:56,620 --> 00:12:01,240
>> Lymph hekk doppjament marbuta,
simili ħafna, id-dritt?

230
00:12:01,240 --> 00:12:05,000
Differenza Biss issa hija aħna
ikollhom jmiss u preċedenti.

231
00:12:05,000 --> 00:12:06,235
Hu l-unika differenza.

232
00:12:06,235 --> 00:12:09,570

233
00:12:09,570 --> 00:12:14,790
>> Hekk jekk konna biex prepend jew append-- aħna
ma jkollhom ebda kodiċi għall dan up here--

234
00:12:14,790 --> 00:12:17,830
imma jekk ġejt biex jippruvaw u
daħħalha, il-ħaġa importanti

235
00:12:17,830 --> 00:12:19,980
huwa inti bżonn tagħmel
żgur li int qed assenjazzjoni

236
00:12:19,980 --> 00:12:23,360
kemm preċedenti tiegħek u tiegħek
pointer jmiss korrett.

237
00:12:23,360 --> 00:12:29,010
Allura f'dan il-każ, inti
mhux biss initialize jmiss,

238
00:12:29,010 --> 00:12:31,820
inti initialize preċedenti.

239
00:12:31,820 --> 00:12:36,960
Jekk aħna qed fil-kap tal-lista, aħna
mhux biss tagħmel ras ugwali ġdid,

240
00:12:36,960 --> 00:12:41,750
iżda għandha preċedenti ġdida tagħna
punt għall-ras, id-dritt?

241
00:12:41,750 --> 00:12:43,380
>> Dik hija l-unika differenza.

242
00:12:43,380 --> 00:12:47,200
U jekk inti tixtieq aktar prattika ma
dawn ma 'listi marbuta, bil ddaħħal,

243
00:12:47,200 --> 00:12:49,900
ma tħassar, ma daħħal
fis lista assortiti,

244
00:12:49,900 --> 00:12:52,670
jekk jogħġbok iċċekkja study.cs50.net.

245
00:12:52,670 --> 00:12:54,870
Hemm mazz ta 'eżerċizzji kbira.

246
00:12:54,870 --> 00:12:55,870
I jirrakkomanda ħafna minnhom.

247
00:12:55,870 --> 00:12:59,210
Nixtieq kellna ħin biex tmur permezz tagħhom
imma hemm ħafna ta 'strutturi ta' dejta

248
00:12:59,210 --> 00:13:01,530
li tinkiseb permezz.

249
00:13:01,530 --> 00:13:02,650
>> OK, hekk tabelli hash.

250
00:13:02,650 --> 00:13:07,070
Din hija probabbilment l-aktar
bit utli għall pset tiegħek

251
00:13:07,070 --> 00:13:11,090
hawnhekk għaliex int ser tkun
implimentazzjoni waħda minn dawn, jew jipprova.

252
00:13:11,090 --> 00:13:12,200
I really simili tabelli hash.

253
00:13:12,200 --> 00:13:13,110
Huma qed pretty jibred.

254
00:13:13,110 --> 00:13:17,080
>> Allura bażikament dak
jiġri huwa tabella hash

255
00:13:17,080 --> 00:13:22,050
huwa meta aħna verament bżonn ta 'malajr
inserzjoni, tħassir, u Lookup.

256
00:13:22,050 --> 00:13:25,010
Dawk huma l-affarijiet li aħna qed
prijoritizzazzjoni f'tabella hash.

257
00:13:25,010 --> 00:13:29,500
Huma jistgħu jiksbu pretty big,
imma kif aħna ser tara mal tentattivi,

258
00:13:29,500 --> 00:13:33,040
hemm affarijiet li huma ħafna akbar.

259
00:13:33,040 --> 00:13:38,330
>> Imma bażikament, kollha hash
tabella hija funzjoni hash

260
00:13:38,330 --> 00:13:47,215
li jgħidlek liema barmil tpoġġi kull
tad-data tiegħek, kull wieħed mill-elementi tiegħek fil.

261
00:13:47,215 --> 00:13:51,140
A mod sempliċi biex jaħsbu ta 'tabella hash
hija li huwa biss bramel ta 'affarijiet,

262
00:13:51,140 --> 00:13:51,770
dritt?

263
00:13:51,770 --> 00:13:59,720
Allura meta inti qed issortjar affarijiet minn
bħall-ewwel ittra ta 'isem tagħhom,

264
00:13:59,720 --> 00:14:01,820
thats tip simili ta 'tabella hash.

265
00:14:01,820 --> 00:14:06,180
>> Mela jekk jien kienu li grupp inti guys huwa
fi gruppi ta 'min jibda l-isem tal-

266
00:14:06,180 --> 00:14:11,670
mal A hawn fuq, jew min birthday
hija f'Jannar, Frar, Marzu,

267
00:14:11,670 --> 00:14:15,220
tkun xi tkun, li tkun effettivament
ħolqien ta 'tabella hash.

268
00:14:15,220 --> 00:14:18,120
Huwa biss joħolqu bramel li
inti sort elementi tiegħek fis

269
00:14:18,120 --> 00:14:19,520
sabiex inti tista 'issibhom aktar faċli.

270
00:14:19,520 --> 00:14:22,300
Allura dan il-mod meta I ħtieġa
biex isibu waħda minnkom,

271
00:14:22,300 --> 00:14:24,680
I ma jkollhomx biex tfittex
permezz ta 'kull ta' ismijiet tiegħek.

272
00:14:24,680 --> 00:14:29,490
I jistgħu jkunu simili, oh, naf li
Birthday Danielle hija in--

273
00:14:29,490 --> 00:14:30,240
UDJENZA: --April.

274
00:14:30,240 --> 00:14:30,948
SPEAKER 1: April.

275
00:14:30,948 --> 00:14:33,120
So I ħarsa f'April tiegħi
barmil, u ma 'kwalunkwe Xorti,

276
00:14:33,120 --> 00:14:38,270
hi ser tkun l-unika waħda fil hemm u
ħin tiegħi kien kostanti f'dan is-sens,

277
00:14:38,270 --> 00:14:41,230
billi jekk I jkollha tħares
permezz mazz sħiħ ta 'persuni,

278
00:14:41,230 --> 00:14:43,090
li għaddej biex jieħu ħafna aktar.

279
00:14:43,090 --> 00:14:45,830
Allura tabelli hash huma verament biss bramel.

280
00:14:45,830 --> 00:14:48,630
Mod faċli biex jaħsbu minnhom.

281
00:14:48,630 --> 00:14:52,930
>> Allura ħaġa importanti ħafna dwar
tabella hash hija funzjoni hash.

282
00:14:52,930 --> 00:14:58,140
Allura l-affarijiet I biss tkellmu dwar, bħal
ewwel ittra tiegħek ta 'l-ewwel isem tiegħek

283
00:14:58,140 --> 00:15:01,450
jew xahar birthday tiegħek,
dawn huma ideat li

284
00:15:01,450 --> 00:15:03,070
verament jikkorrelataw għal funzjoni hash.

285
00:15:03,070 --> 00:15:08,900
Huwa biss mod biex tiddeċiedi liema
barmil inti element qed tmur fi, OK?

286
00:15:08,900 --> 00:15:14,850
Allura għal dan pset, inti tista 'tfittex up
pretty ħafna xi funzjoni hash tixtieq.

287
00:15:14,850 --> 00:15:16,030
>> Ma għandhom ikunu tiegħek stess.

288
00:15:16,030 --> 00:15:21,140
Hemm xi dawk verament jibred out
hemmhekk li jagħmlu kull tip ta matematika crazy.

289
00:15:21,140 --> 00:15:25,170
U jekk inti tixtieq li tagħmel tiegħek
spellchecker super fast,

290
00:15:25,170 --> 00:15:27,620
Nixtieq definittivament
tħares lejn wieħed minn dawn.

291
00:15:27,620 --> 00:15:32,390
>> Imma hemm ukoll l-
dawk sempliċi, bħal jikkomputa

292
00:15:32,390 --> 00:15:39,010
is-somma tal-kliem, bħal
kull ittra għandha numru.

293
00:15:39,010 --> 00:15:39,940
Kkalkulata l-ammont.

294
00:15:39,940 --> 00:15:42,230
Li jiddetermina l-barmil.

295
00:15:42,230 --> 00:15:45,430
Huma għandhom ukoll dawk faċli li
huma biss simili kollha tal-li A hawn,

296
00:15:45,430 --> 00:15:47,050
kollha tal-B hawnhekk.

297
00:15:47,050 --> 00:15:48,920
Kwalunkwe wieħed minn dawk.

298
00:15:48,920 --> 00:15:55,770
>> Bażikament, hija biss jgħidlek liema
indiċi array element tiegħek għandhom imorru fis.

299
00:15:55,770 --> 00:15:58,690
Just tiddeċiedi l-bucket--
dan kollu funzjoni hash huwa.

300
00:15:58,690 --> 00:16:04,180
Allura hawnhekk għandna eżempju li hija
biss l-ewwel ittra tas-sekwenza

301
00:16:04,180 --> 00:16:05,900
li I kien biss jitkellem dwar.

302
00:16:05,900 --> 00:16:11,900
>> Hekk ikollok xi hash li jinsab biss l-
ewwel ittra ta 'sekwenza tiegħek minus A,

303
00:16:11,900 --> 00:16:16,090
li se jagħtuk xi
numru bejn 0 u 25.

304
00:16:16,090 --> 00:16:20,790
U dak li trid tagħmel hu li
kun żgur li dan jirrappreżenta

305
00:16:20,790 --> 00:16:24,110
id-daqs tal-hash tiegħek table--
kemm bramel hemm.

306
00:16:24,110 --> 00:16:25,860
Ma 'ħafna minn dawn
funzjonijiet hash, dawn qed

307
00:16:25,860 --> 00:16:31,630
ser ikunu valuri jirritorna li tista
ikun ferm ogħla mill-għadd ta 'bramel

308
00:16:31,630 --> 00:16:33,610
li inti fil-fatt ikollhom
fit-tabella hash tiegħek,

309
00:16:33,610 --> 00:16:37,240
sabiex inti għandek bżonn tagħmel
żgur u MoD minn dawk.

310
00:16:37,240 --> 00:16:42,190
Inkella, li għaddej biex jgħidu,
oh, għandha tkun fil-barmil 5,000

311
00:16:42,190 --> 00:16:46,040
imma inti biss għandek 30
bramel fit-tabella hash tiegħek.

312
00:16:46,040 --> 00:16:49,360
U ovvjament, aħna lkoll nafu li l-
se jirriżulta xi żbalji crazy.

313
00:16:49,360 --> 00:16:52,870
Sabiex tagħmel ċert li Mod mill-
daqs tal-mejda hash tiegħek.

314
00:16:52,870 --> 00:16:58,430

315
00:16:58,430 --> 00:16:58,930
Kessaħ.

316
00:16:58,930 --> 00:17:00,506
Hekk kolliżjonijiet.

317
00:17:00,506 --> 00:17:02,620
Huwa kulħadd tajba s'issa?

318
00:17:02,620 --> 00:17:03,120
Mmhmm?

319
00:17:03,120 --> 00:17:05,900
>> UDJENZA: Għaliex kieku dan
ritorn ta 'tali valur enormi?

320
00:17:05,900 --> 00:17:09,210
>> SPEAKER 1: Jiddependi fuq l-algoritmu
dik il-funzjoni hash tiegħek juża.

321
00:17:09,210 --> 00:17:12,270
Xi wħud minnhom se do
multiplikazzjoni crazy.

322
00:17:12,270 --> 00:17:16,270
U dan kollu dwar jkollna
distribuzzjoni li,

323
00:17:16,270 --> 00:17:18,490
sabiex ikunu jagħmlu xi verament
affarijiet crazy kultant.

324
00:17:18,490 --> 00:17:20,960
Li kollox.

325
00:17:20,960 --> 00:17:22,140
Xi ħaġa oħra?

326
00:17:22,140 --> 00:17:22,829
OK.

327
00:17:22,829 --> 00:17:24,480
>> Hekk kolliżjonijiet.

328
00:17:24,480 --> 00:17:29,270
Bażikament, kif għidt qabel,
fix-xenarju aħjar każ,

329
00:17:29,270 --> 00:17:32,040
kwalunkwe barmil I tħares lejn huwa
se jkollhom ħaġa waħda,

330
00:17:32,040 --> 00:17:34,160
so I ma jkollhom ħarsa fil-livelli kollha, id-dritt?

331
00:17:34,160 --> 00:17:37,040
I jew taf huwa hemmhekk jew huwa
mhux, u dak hu li aħna verament irridu.

332
00:17:37,040 --> 00:17:43,960
Imma jekk ikollna għexieren ta 'eluf ta'
punti tad-data u inqas minn dak in-numru

333
00:17:43,960 --> 00:17:48,700
ta 'bramel, aħna qed tmur biex ikollhom
kolliżjonijiet fejn eventwalment xi ħaġa

334
00:17:48,700 --> 00:17:54,210
se jkollhom jispiċċaw fil-
barmil li diġà għandu element.

335
00:17:54,210 --> 00:17:57,390
>> Għalhekk il-kwistjoni hija, dak
nagħmlu f'dak il-każ?

336
00:17:57,390 --> 00:17:58,480
X'nagħmlu?

337
00:17:58,480 --> 00:17:59,300
Aħna diġà għandhom xi ħaġa hemmhekk?

338
00:17:59,300 --> 00:18:00,060
Do we biss tarmi it out?

339
00:18:00,060 --> 00:18:00,700
>> No

340
00:18:00,700 --> 00:18:01,980
Għandna biex iżommu tnejn minnhom.

341
00:18:01,980 --> 00:18:06,400
Allura l-mod li aħna
tipikament tagħmel dan huwa dak?

342
00:18:06,400 --> 00:18:08,400
X'inhu l-istruttura tad-data
aħna biss tkellem dwar?

343
00:18:08,400 --> 00:18:09,316
UDJENZA: lista Marbuta.

344
00:18:09,316 --> 00:18:10,500
SPEAKER 1: Lista marbuta.

345
00:18:10,500 --> 00:18:16,640
Allura issa, minflok ta 'kull wieħed minn dawn
bramel biss li element wieħed,

346
00:18:16,640 --> 00:18:24,020
li għaddej biex jkun fih lista marbuta ta '
l-elementi li ġew hashed fis dan.

347
00:18:24,020 --> 00:18:27,588
OK, ma kulħadd tip ta 'nikseb dik l-idea?

348
00:18:27,588 --> 00:18:30,546
Għaliex aħna ma jista 'jkollha firxa
għaliex aħna ma jafux kif ħafna affarijiet

349
00:18:30,546 --> 00:18:31,730
ser ikunu fil hemmhekk.

350
00:18:31,730 --> 00:18:36,540
Lista marbuta jippermetti li
għadek in-numru eżatt li

351
00:18:36,540 --> 00:18:38,465
huma hashed f'dak barmil, id-dritt?

352
00:18:38,465 --> 00:18:42,260

353
00:18:42,260 --> 00:18:50,500
>> Allura lineari probing huwa
bażikament dan idea--

354
00:18:50,500 --> 00:18:52,300
huwa mod wieħed biex jittrattaw ħabta.

355
00:18:52,300 --> 00:18:58,010
X'tista 'tagħmel hija jekk, f'dan il-
każ, berry kien hashed fis 1

356
00:18:58,010 --> 00:19:01,130
u diġà għandna
xi ħaġa hemmhekk, inti biss

357
00:19:01,130 --> 00:19:04,840
iżommu għaddejjin isfel sakemm
issib slot vojta.

358
00:19:04,840 --> 00:19:06,370
C'est mod wieħed biex jimmaniġġaw dan.

359
00:19:06,370 --> 00:19:09,020
Il-mod ieħor biex jimmaniġġaw
huwa ma dak li aħna biss

360
00:19:09,020 --> 00:19:12,280
called-- il marbut
lista tissejjaħ chaining.

361
00:19:12,280 --> 00:19:20,510
>> Allura din l-idea xogħlijiet jekk
tabella hash tiegħek taħseb

362
00:19:20,510 --> 00:19:24,150
huwa ħafna ikbar minn
data tiegħek sett jew jekk inti

363
00:19:24,150 --> 00:19:28,870
jridu jippruvaw u jimminimizzaw ikkatenar
sakemm huwa assolutament neċessarju.

364
00:19:28,870 --> 00:19:34,050
Allura ħaġa waħda hija lineari
probing ovvjament ifisser

365
00:19:34,050 --> 00:19:37,290
dik il-funzjoni hash tiegħek
mhux daqshekk utli

366
00:19:37,290 --> 00:19:42,200
għaliex int ser jispiċċaw jużaw
funzjoni hash tiegħek, jkollna sa punt,

367
00:19:42,200 --> 00:19:46,400
inti lineari sonda isfel sa
xi post li hija disponibbli.

368
00:19:46,400 --> 00:19:49,670
Imma issa, naturalment, xejn
inkella li jispiċċa hemm,

369
00:19:49,670 --> 00:19:52,050
int ser ikollhom
tfittxija anke aktar 'l isfel.

370
00:19:52,050 --> 00:19:55,650
>> U hemm ħafna aktar
spejjeż tat-tiftix li

371
00:19:55,650 --> 00:19:59,820
tmur fil inputjar element
fit-tabella hash tiegħek issa, id-dritt?

372
00:19:59,820 --> 00:20:05,640
U issa meta inti tmur u jippruvaw isibu
berry darb'oħra, int ser issir hash lilha,

373
00:20:05,640 --> 00:20:07,742
u li għaddej biex jgħidu,
oh, ħarsa fil barmil 1,

374
00:20:07,742 --> 00:20:09,700
u mhuwiex ser ikun
fil-barmil 1, hekk int

375
00:20:09,700 --> 00:20:11,970
ser ikollhom travers
permezz tal-bqija ta 'dawn.

376
00:20:11,970 --> 00:20:17,720
Allura huwa kultant utli,
iżda f'ħafna każijiet,

377
00:20:17,720 --> 00:20:22,660
aħna qed tmur biex ngħid li
chaining huwa dak li inti trid tagħmel.

378
00:20:22,660 --> 00:20:25,520
>> Allura aħna tkellimna dwar dan qabel.

379
00:20:25,520 --> 00:20:27,812
I ltqajna l quddiem ftit ta 'myself.

380
00:20:27,812 --> 00:20:33,560
Iżda chaining huwa bażikament dak
kull barmil fit-tabella hash tiegħek

381
00:20:33,560 --> 00:20:36,120
huwa biss lista marbuta.

382
00:20:36,120 --> 00:20:39,660
>> Allura mod ieħor, jew aktar tekniċi
mod, biex jaħsbu ta 'tabella hash

383
00:20:39,660 --> 00:20:44,490
hija li huwa biss firxa
ta 'listi marbuta, li

384
00:20:44,490 --> 00:20:49,330
meta int bil-miktub dizzjunarju tiegħek
u inti qed tipprova tagħbija,

385
00:20:49,330 --> 00:20:52,070
ħsieb ta 'dan bħala
firxa ta 'listi marbuta

386
00:20:52,070 --> 00:20:54,390
se tagħmilha aktar faċli
għalik biex initialize.

387
00:20:54,390 --> 00:20:57,680
>> UDJENZA: Allura tabella hash
għandu daqs predeterminat,

388
00:20:57,680 --> 00:20:58,980
bħal [inaudible] tal bramel?

389
00:20:58,980 --> 00:20:59,220
>> SPEAKER 1: Dritt.

390
00:20:59,220 --> 00:21:01,655
Għalhekk għandha numru sett ta '
bramel li inti determine--

391
00:21:01,655 --> 00:21:03,530
li inti guys għandhom
tħossok liberu li jilagħbu bil.

392
00:21:03,530 --> 00:21:05,269
Jista 'jkun pjuttost jibred
biex tara x'jiġri

393
00:21:05,269 --> 00:21:06,810
kif int bdilt numru tiegħek ta 'bramel.

394
00:21:06,810 --> 00:21:09,410

395
00:21:09,410 --> 00:21:11,510
Iżda yeah, hija għandha
sett numru ta 'bramel.

396
00:21:11,510 --> 00:21:15,360
Dak li jippermetti li inti tajbin bħala
ħafna elementi kif għandek bżonn

397
00:21:15,360 --> 00:21:19,350
huwa fejn dan chaining separata inti
jkunu marbuta listi f'kull barmil.

398
00:21:19,350 --> 00:21:22,850
Dan ifisser tabella hash tiegħek
se tkun eżattament id-daqs

399
00:21:22,850 --> 00:21:25,440
li inti jeħtieġ li tkun, id-dritt?

400
00:21:25,440 --> 00:21:27,358
Dik hija l-punt kollu ta 'listi marbuta.

401
00:21:27,358 --> 00:21:30,850

402
00:21:30,850 --> 00:21:32,480
Kessaħ.

403
00:21:32,480 --> 00:21:38,780
>> Allura kulħadd OK hemmhekk?

404
00:21:38,780 --> 00:21:39,801
Kull dritt.

405
00:21:39,801 --> 00:21:40,300
Ah.

406
00:21:40,300 --> 00:21:41,860
Dak li ġara biss?

407
00:21:41,860 --> 00:21:42,960
Verament issa.

408
00:21:42,960 --> 00:21:45,250
Aqta 'xi ħadd qtil lili.

409
00:21:45,250 --> 00:21:52,060
>> OK aħna qed tmur biex jmorru fil
tentattivi, li huma ftit crazy.

410
00:21:52,060 --> 00:21:53,140
I simili tabelli hash.

411
00:21:53,140 --> 00:21:54,460
Jien naħseb li qed verament jibred.

412
00:21:54,460 --> 00:21:56,710
Jipprova huma jibred, wisq.

413
00:21:56,710 --> 00:21:59,590
>> Sabiex ħadd ma tiftakar dak jipprova hu?

414
00:21:59,590 --> 00:22:01,740
Għandek mxew fuq
fil-qosor fil-lecture?

415
00:22:01,740 --> 00:22:04,570

416
00:22:04,570 --> 00:22:06,377
Do you remember-tip ta 'kif taħdem?

417
00:22:06,377 --> 00:22:08,460
UDJENZA: Jien biss nodding
li aħna ma jmorru fuq dan.

418
00:22:08,460 --> 00:22:09,626
SPEAKER 1: We do jmorru fuq dan.

419
00:22:09,626 --> 00:22:13,100
OK, aħna qed verament se jmorru
fuq issa huwa dak li aħna qed tgħid.

420
00:22:13,100 --> 00:22:14,860
>> UDJENZA: Li għal siġra irkupru.

421
00:22:14,860 --> 00:22:15,280
>> SPEAKER 1: Yeah.

422
00:22:15,280 --> 00:22:16,196
Huwa siġra irkupru.

423
00:22:16,196 --> 00:22:16,960
Biża.

424
00:22:16,960 --> 00:22:23,610
Allura ħaġa waħda li l-avviż hawnhekk hija li aħna
qed iħarsu lejn karattri individwali

425
00:22:23,610 --> 00:22:24,480
hawn, id-dritt?

426
00:22:24,480 --> 00:22:29,710
>> Allura qabel b'funzjoni hash tagħna, aħna
kienu qed ifittxu fil-kliem kollha kemm hi,

427
00:22:29,710 --> 00:22:32,270
u issa aħna qed tfittex aktar
fil-karattri, right?

428
00:22:32,270 --> 00:22:38,380
Allura aħna għandna Maxwell hawn fuq u Mendel.

429
00:22:38,380 --> 00:22:47,840
Allura bażikament try-- mod biex jaħsbu
dwar dan hija li kull livell hawn

430
00:22:47,840 --> 00:22:49,000
firxa ta 'ittri.

431
00:22:49,000 --> 00:22:53,310

432
00:22:53,310 --> 00:22:55,790
Allura dan huwa node għerq tiegħek hawn, id-dritt?

433
00:22:55,790 --> 00:23:01,980
Dan għandu l-karattri tal-
alfabett għall-bidu ta 'kull kelma.

434
00:23:01,980 --> 00:23:06,480
>> U dak li trid tagħmel hu li
jiġifieri, OK, aħna għandna xi kelma M.

435
00:23:06,480 --> 00:23:10,590
Aħna qed tmur biex tfittex Maxwell, hekk
immorru 'M. u M-punti lill-impjegati whole

436
00:23:10,590 --> 00:23:14,800
oħra firxa fejn kull
kelma, sakemm ikun hemm

437
00:23:14,800 --> 00:23:17,044
hija kelma li għandha
bħala t-tieni ittra,

438
00:23:17,044 --> 00:23:19,460
sakemm hemm kelma li
għandha B bħala t-tieni ittra,

439
00:23:19,460 --> 00:23:24,630
din se jkollha pointer
jmorru għal xi firxa li jmiss.

440
00:23:24,630 --> 00:23:29,290
>> Hemm probabilment mhux
kelma li xi ħaġa MP,

441
00:23:29,290 --> 00:23:32,980
hekk fil-pożizzjoni P f'dan
firxa, ikun biss NULL.

442
00:23:32,980 --> 00:23:38,840
Hija ngħid, OK, m'hemm l-ebda kelma
li M segwit minn P, OK?

443
00:23:38,840 --> 00:23:43,100
Allura jekk aħna taħseb dwarha, kull
wieħed minn dawn l-affarijiet iżgħar

444
00:23:43,100 --> 00:23:47,990
huwa attwalment wieħed minn dawn
arrays kbar mill A permezz Z.

445
00:23:47,990 --> 00:23:55,064
Allura dak li jista 'jkun waħda mill-affarijiet
li huwa tip ta 'żvantaġġ ta jipprova?

446
00:23:55,064 --> 00:23:56,500
>> UDJENZA: A lott ta 'memorja.

447
00:23:56,500 --> 00:23:59,940
>> SPEAKER 1: Huwa ton ta 'memorja, id-dritt?

448
00:23:59,940 --> 00:24:08,750
Kull waħda minn dawn il-blokok hawn
jirrappreżenta 26 spazji, 26 element array.

449
00:24:08,750 --> 00:24:13,680
Allura tipprova tikseb oerhört tqil ispazju.

450
00:24:13,680 --> 00:24:17,100
>> Iżda huma malajr ħafna.

451
00:24:17,100 --> 00:24:22,540
Allura oerhört mgħaġġel iżda
verament ispazju ineffiċjenti.

452
00:24:22,540 --> 00:24:24,810
Tip ta 'għandek figura
out liema waħda tixtieq.

453
00:24:24,810 --> 00:24:29,470
Dawn huma verament jiksaħ għal pset tiegħek,
iżda dawn ma jieħdu ħafna ta 'memorja,

454
00:24:29,470 --> 00:24:30,290
sabiex inti kummerċ off.

455
00:24:30,290 --> 00:24:31,480
Yeah?

456
00:24:31,480 --> 00:24:34,300
>> UDJENZA: Ikun possibbli
li jitwaqqaf jipprova u mbagħad

457
00:24:34,300 --> 00:24:37,967
ladarba inti għandek l-
data fiha li inti need--

458
00:24:37,967 --> 00:24:39,550
I do not know jekk dan jagħmel sens.

459
00:24:39,550 --> 00:24:42,200
I kien jwarrbu l-
Karattri NULL, iżda mbagħad

460
00:24:42,200 --> 00:24:42,910
inti ma tkunx kapaċi indiċi them--

461
00:24:42,910 --> 00:24:43,275
>> SPEAKER 1: Inti xorta jkollok bżonn lilhom.

462
00:24:43,275 --> 00:24:44,854
>> UDJENZA: - bl-istess mod kull darba.

463
00:24:44,854 --> 00:24:45,520
SPEAKER 1: Yeah.

464
00:24:45,520 --> 00:24:50,460
Ikollok bżonn l-karattri NULL let
inti taf jekk hemm Ma kelma hemmhekk.

465
00:24:50,460 --> 00:24:52,040
Ben kellek xi ħaġa li trid?

466
00:24:52,040 --> 00:24:52,540
OK.

467
00:24:52,540 --> 00:24:54,581
Kull dritt, hekk aħna qed tmur
li jmorru ftit aktar

468
00:24:54,581 --> 00:24:58,920
fil-dettalji tekniċi wara
jipprova u joperaw permezz ta 'eżempju.

469
00:24:58,920 --> 00:25:01,490
>> OK, għalhekk dan huwa l-istess ħaġa.

470
00:25:01,490 --> 00:25:06,290
Billi fil-lista marbuta, prinċipali tagħna
tip of-- x'inhu l-kelma Irrid? -

471
00:25:06,290 --> 00:25:08,350
bħall-bini blokk kien node.

472
00:25:08,350 --> 00:25:12,280
Fil jipprova, aħna għandna wkoll node,
imma hija definita b'mod differenti.

473
00:25:12,280 --> 00:25:17,000
>> Allura aħna għandna xi BOOL li
tirrappreżenta jekk kelma attwalment

474
00:25:17,000 --> 00:25:23,530
jeżisti dan il-post, u mbagħad
għandna xi firxa here-- jew pjuttost,

475
00:25:23,530 --> 00:25:27,840
dan huwa pointer għal
firxa ta '27 karattri.

476
00:25:27,840 --> 00:25:33,339
U dan huwa għal, f'dan il-każ, din
27-- Jien ċert kollha inti simili, stenna,

477
00:25:33,339 --> 00:25:34,880
hemm 26-ittri fil-alfabett.

478
00:25:34,880 --> 00:25:36,010
Għalfejn għandna 27?

479
00:25:36,010 --> 00:25:37,870
>> Allura jiddependi fuq il-
mod inti jimplimentaw din,

480
00:25:37,870 --> 00:25:43,240
dan huwa minn pset li
permessi għall apostrophes.

481
00:25:43,240 --> 00:25:46,010
Allura hu għalhekk li l-waħda żejda.

482
00:25:46,010 --> 00:25:50,500
Int ser ikollok wkoll f'xi wħud
każijiet il-terminatur null

483
00:25:50,500 --> 00:25:53,230
hija nkluża bħala waħda mill-
karattri li huwa permess li jkun,

484
00:25:53,230 --> 00:25:56,120
u li kif jivverifikaw li
tara jekk huwa l-aħħar tal-kelma.

485
00:25:56,120 --> 00:26:01,340
Jekk int interessat, check out
Video Kevin dwar study.cs50,

486
00:26:01,340 --> 00:26:04,790
kif ukoll Wikipedija għandha
xi riżorsi tajbin hemmhekk.

487
00:26:04,790 --> 00:26:09,000
>> Iżda aħna qed tmur biex jgħaddu biss tip
ta 'kif inti tista' taħdem permezz jipprova

488
00:26:09,000 --> 00:26:11,010
jekk int tingħata waħda.

489
00:26:11,010 --> 00:26:16,230
Allura aħna għandna waħda super sempliċi hawnhekk li
għandha l-kliem "BAT" u "zoom" fihom.

490
00:26:16,230 --> 00:26:18,920
U kif naraw up here,
dan l-ispazju ftit hawn

491
00:26:18,920 --> 00:26:22,560
jirrappreżenta BOOL tagħna li
jgħid, iva, dan huwa kelma.

492
00:26:22,560 --> 00:26:27,060
U allura dan għandu tagħna
arrays ta 'karattri, id-dritt?

493
00:26:27,060 --> 00:26:33,480
>> Allura aħna se jmorru permezz
sejba "BAT" f'dan jipprova.

494
00:26:33,480 --> 00:26:38,340
Allura tibda fil-quċċata, id-dritt?

495
00:26:38,340 --> 00:26:46,290
U aħna nafu li b jikkorrispondi għal
it-tieni indiċi, it-tieni element

496
00:26:46,290 --> 00:26:47,840
f'dan array, għaliex u b.

497
00:26:47,840 --> 00:26:51,340
Allura madwar it-tieni wieħed.

498
00:26:51,340 --> 00:26:58,820
>> U jgħid, OK, berred, segwi dan in
l-array li jmiss, għaliex jekk aħna niftakru,

499
00:26:58,820 --> 00:27:02,160
mhuwiex li kull wieħed minn dawn
attwalment fiha l-element.

500
00:27:02,160 --> 00:27:07,110
Kull wieħed minn dawn arrays
fih pointer, id-dritt?

501
00:27:07,110 --> 00:27:10,030
Huwa distinzjoni importanti biex jagħmlu.

502
00:27:10,030 --> 00:27:13,450
>> Naf li dan se be-- jipprova huma
verament diffiċli biex jiksbu fuq l-ewwel darba,

503
00:27:13,450 --> 00:27:15,241
hekk anke jekk dan huwa l-
tieni jew it-tielet darba

504
00:27:15,241 --> 00:27:18,370
u huwa għadu tip
ta seeming diffiċli,

505
00:27:18,370 --> 00:27:21,199
I wegħda jekk inti tmur watch
l-qasir għal darb'oħra għada,

506
00:27:21,199 --> 00:27:22,740
inneħħu probabbilment jagħmlu sens ħafna aktar.

507
00:27:22,740 --> 00:27:23,890
Huwa jieħu ħafna biex diġestiva.

508
00:27:23,890 --> 00:27:27,800
I still kultant am
simili, stenna, dak li huwa jipprova?

509
00:27:27,800 --> 00:27:29,080
Kif nista jużaw dan?

510
00:27:29,080 --> 00:27:33,880
>> Allura għandna b f'dan il-każ,
li hija t-tieni indiċi tagħna.

511
00:27:33,880 --> 00:27:40,240
Jekk kellna, jiġifieri, C jew
d jew kull ittra oħra,

512
00:27:40,240 --> 00:27:45,810
għandna bżonn li Mappa li lura għall-indiċi
ta 'firxa tagħna li dan jikkorrispondi għal.

513
00:27:45,810 --> 00:27:56,930
Allura aħna se tieħu bħal rchar u aħna biss
naqqas off biex iħażżu fis 0-25.

514
00:27:56,930 --> 00:27:58,728
Kulħadd tajba kif aħna
Mappa karattri tagħna?

515
00:27:58,728 --> 00:28:00,440
OK.

516
00:28:00,440 --> 00:28:05,980
>> Allura immorru għat-tieni waħda u aħna
tara li, iva, huwa ma NULL.

517
00:28:05,980 --> 00:28:07,780
Aħna tista 'timxi fuq dan array li jmiss.

518
00:28:07,780 --> 00:28:12,300
Allura aħna jmorru fuq għal din array li jmiss hawn.

519
00:28:12,300 --> 00:28:15,500
>> U aħna ngħidu, OK, issa aħna
bżonn biex tara jekk huwa hawnhekk.

520
00:28:15,500 --> 00:28:18,590
Huwa A null jew ma dan
attwalment jimxu 'l quddiem?

521
00:28:18,590 --> 00:28:21,880
Allura fil-fatt jiċċaqlaq
jgħaddi f'din firxa.

522
00:28:21,880 --> 00:28:24,570
U aħna ngħidu, OK, t hija l-aħħar ittra tagħna.

523
00:28:24,570 --> 00:28:27,580
Allura immorru l-t fil-indiċi.

524
00:28:27,580 --> 00:28:30,120
U allura aħna nimxu 'l quddiem
għaliex hemm wieħed ieħor.

525
00:28:30,120 --> 00:28:38,340
U dan wieħed jgħid bażikament li, iva,
jgħid li hemm kelma here--

526
00:28:38,340 --> 00:28:41,750
li jekk inti ssegwi dan
triq, inti jkunu waslu

527
00:28:41,750 --> 00:28:43,210
fi ftit kliem, li nafu huwa "BAT."

528
00:28:43,210 --> 00:28:43,800
Iva?

529
00:28:43,800 --> 00:28:46,770
>> UDJENZA: Huwa standard li jkollhom dik
bħala indiċi 0 u mbagħad ikollhom tip ta '1

530
00:28:46,770 --> 00:28:47,660
jew li jkollu fl-aħħar?

531
00:28:47,660 --> 00:28:48,243
>> SPEAKER 1: No

532
00:28:48,243 --> 00:28:55,360
Mela jekk inħarsu lura lejn tagħna
dikjarazzjoni hawn, huwa BOOL,

533
00:28:55,360 --> 00:28:59,490
dan huwa element tagħha stess fil node tiegħek.

534
00:28:59,490 --> 00:29:03,331
Dan mhuwiex parti mill-firxa.

535
00:29:03,331 --> 00:29:03,830
Kessaħ.

536
00:29:03,830 --> 00:29:08,370
Allura meta aħna finitura kelma tagħna u aħna qed
f'dan array, dak li rridu nagħmlu

537
00:29:08,370 --> 00:29:12,807
hija tagħmel verifika għal dan huwa kelma.

538
00:29:12,807 --> 00:29:14,390
U f'dan il-każ, ikun ritorn iva.

539
00:29:14,390 --> 00:29:17,220

540
00:29:17,220 --> 00:29:24,090
>> Allura fuq din in-nota, aħna nafu li "zoo" -
nafu bħala bnedmin li "zoo" hija kelma,

541
00:29:24,090 --> 00:29:24,820
dritt?

542
00:29:24,820 --> 00:29:28,990
Iżda huma jippruvaw hawnhekk
jgħidu, l-ebda, mhuwiex.

543
00:29:28,990 --> 00:29:33,980
U ngħid li għaliex aħna
ma jkunux ħatru bħala kelma hawn.

544
00:29:33,980 --> 00:29:40,440
Anki jekk nistgħu travers
permezz ta 'dan array,

545
00:29:40,440 --> 00:29:43,890
dan jipprova ngħid li, no,
zoo ma jkunx dizzjunarju tiegħek

546
00:29:43,890 --> 00:29:47,070
għaliex għandna ma
nnominata bħala tali.

547
00:29:47,070 --> 00:29:52,870
>> Allura mod wieħed biex tagħmel that--
oh, sorry, dan wieħed.

548
00:29:52,870 --> 00:29:59,450
Allura f'dan il-każ, "zoo" mhijiex
kelma, imma huwa fl jipprova tagħna.

549
00:29:59,450 --> 00:30:05,690
Iżda f'dan il-wieħed, ngħidu aħna jriduhom
jintroduċu l-kelma "banju," dak li jiġri

550
00:30:05,690 --> 00:30:08,260
hija aħna isegwu through-- b, a, t.

551
00:30:08,260 --> 00:30:11,820
Aħna f'dan array, u
immorru tiftix għal h.

552
00:30:11,820 --> 00:30:15,220
>> F'dan il-każ, meta aħna
tħares lejn il-pointer fuq h,

553
00:30:15,220 --> 00:30:17,890
huwa tipponta lejn NULL, OK?

554
00:30:17,890 --> 00:30:20,780
Allura sakemm huwa espliċitament
tipponta lejn firxa ieħor,

555
00:30:20,780 --> 00:30:25,000
għandek tassumi li l-pointers
f'dan array huma tipponta lejn nulla.

556
00:30:25,000 --> 00:30:28,270
Allura f'dan il-każ, h hija li tipponta
biex nulla hekk aħna ma tistax tagħmel xejn,

557
00:30:28,270 --> 00:30:31,540
għalhekk ikun ukoll ritorn
falza, "banju" mhijiex fil hawn.

558
00:30:31,540 --> 00:30:34,102

559
00:30:34,102 --> 00:30:35,810
Allura issa aħna qed attwalment
se jmorru permezz

560
00:30:35,810 --> 00:30:39,790
kif kieku għandna attwalment ngħid
li "zoo" hija fil jippruvaw tagħna.

561
00:30:39,790 --> 00:30:42,920
Kif nistgħu daħħal "zoo" fis jipprova tagħna?

562
00:30:42,920 --> 00:30:47,810
Allura bl-istess mod li bdejna ma '
lista marbuta tagħna, aħna tibda fil-għerq.

563
00:30:47,810 --> 00:30:50,600
Meta fid-dubju, tibda fil
l-għerq ta 'dawn l-affarijiet.

564
00:30:50,600 --> 00:30:53,330
>> U aħna ser ngħidu, OK, z.

565
00:30:53,330 --> 00:30:55,650
z teżisti f'dan, u ma.

566
00:30:55,650 --> 00:30:58,370
Allura inti qed jimxu fuq
firxa jmiss tiegħek, OK?

567
00:30:58,370 --> 00:31:01,482
U mbagħad fuq il-wieħed li jmiss,
ngħidu, OK, ma o jeżistu?

568
00:31:01,482 --> 00:31:03,000
Hija ma.

569
00:31:03,000 --> 00:31:04,330
Dan jerġa.

570
00:31:04,330 --> 00:31:08,670
>> U hekk dak li jmiss tagħna, konna qal,
OK, "zoo" diġà jeżisti hawnhekk.

571
00:31:08,670 --> 00:31:12,440
Kollha għandna bżonn tagħmel huwa stabbilit dan ugwali
li veru, li hemm kelma hemmhekk.

572
00:31:12,440 --> 00:31:15,260
Jekk inti kienu segwiti kollox
sa qabel dak il-punt,

573
00:31:15,260 --> 00:31:17,030
huwa kelma, hekk biss
huwa stabbilit ugwali għal tali.

574
00:31:17,030 --> 00:31:17,530
Iva?

575
00:31:17,530 --> 00:31:22,550
>> UDJENZA: Mela allura ma li
jfisser li "BA" hija kelma wkoll?

576
00:31:22,550 --> 00:31:24,120
>> SPEAKER 1: No

577
00:31:24,120 --> 00:31:28,870
Allura f'dan il-każ, "ba" aħna se tikseb
hawnhekk, aħna ngħid huwa kelma,

578
00:31:28,870 --> 00:31:31,590
u xorta jkun hemm ebda.

579
00:31:31,590 --> 00:31:32,822
OK?

580
00:31:32,822 --> 00:31:33,740
Mmhmm?

581
00:31:33,740 --> 00:31:36,360
>> UDJENZA: Allura ladarba inti ma hija
kelma u inti tgħidli iva, allura huwa

582
00:31:36,360 --> 00:31:38,380
se jkun fihom biex tmur m?

583
00:31:38,380 --> 00:31:42,260
>> SPEAKER 1: Allura dan għandu ma
with-- int tagħbija dan fil.

584
00:31:42,260 --> 00:31:43,640
You say "zoo" hija kelma.

585
00:31:43,640 --> 00:31:47,020
Meta inti tmur check--
bħal, ngħidu li inti trid tgħid,

586
00:31:47,020 --> 00:31:49,400
ma "zoo" jeżistu f'dan dizzjunarju?

587
00:31:49,400 --> 00:31:54,200
Int biss tmur biex tfittex għal "zoo,"
u mbagħad tiċċekkja biex tara jekk huwa kelma.

588
00:31:54,200 --> 00:31:57,291
Inti qatt ma ser jiċċaqalqu
permezz ta 'm għaliex li mhux

589
00:31:57,291 --> 00:31:58,290
dak li qed tfittex.

590
00:31:58,290 --> 00:32:02,690

591
00:32:02,690 --> 00:32:08,070
>> Hekk jekk aħna fil-fatt riedu
żid "banju" fis dan jipprova,

592
00:32:08,070 --> 00:32:11,390
aħna se nagħmlu l-istess ħaġa
kif għamilna ma "zoo,"

593
00:32:11,390 --> 00:32:15,380
ħlief aħna se tara li meta aħna
tipprova u tikseb sabiex h, dan ma jeżistix.

594
00:32:15,380 --> 00:32:20,090
Allura inti tista 'taħseb ta' dan bħala jippruvaw
li żżid node ġdid ġo lista marbuta,

595
00:32:20,090 --> 00:32:27,210
hekk aħna se bżonn li żżid ieħor
waħda minn dawn arrays, bħal hekk.

596
00:32:27,210 --> 00:32:35,670
U allura dak li nagħmlu huwa aħna biss stabbiliti l-h
element ta 'dan array li tipponta lejn dan.

597
00:32:35,670 --> 00:32:39,430
>> U allura dak li rridu nagħmlu hawn?

598
00:32:39,430 --> 00:32:43,110
Iżżidhiex ugwali għal veru
għaliex dan huwa kelma.

599
00:32:43,110 --> 00:32:46,350

600
00:32:46,350 --> 00:32:48,150
Kessaħ.

601
00:32:48,150 --> 00:32:48,700
I know.

602
00:32:48,700 --> 00:32:51,170
Tipprova mhumiex l-aktar eċċitanti.

603
00:32:51,170 --> 00:32:54,250
Trust me, I know.

604
00:32:54,250 --> 00:32:58,040
>> Allura ħaġa waħda li tirrealizza ma tentattivi,
I said, dawn qed effiċjenti ħafna.

605
00:32:58,040 --> 00:33:00,080
Allura aħna stajt tidher li
jieħdu ton ta 'spazju.

606
00:33:00,080 --> 00:33:01,370
Huma qed tip ta 'konfużjoni.

607
00:33:01,370 --> 00:33:03,367
Allura għaliex kieku aħna qatt tuża dawn?

608
00:33:03,367 --> 00:33:05,450
Aħna nużaw dawn għaliex qed
oerhört effiċjenti.

609
00:33:05,450 --> 00:33:08,130
>> Mela jekk inti qed tfittex qatt
up kelma, inti biss

610
00:33:08,130 --> 00:33:10,450
li tmiss mit-tul tal-kelma.

611
00:33:10,450 --> 00:33:15,210
Mela jekk inti qed tfittex għal
kelma li huwa ta 'tul ħamsa,

612
00:33:15,210 --> 00:33:20,940
int biss qatt ser ikollhom
jagħmlu iktar ħames paraguni, OK?

613
00:33:20,940 --> 00:33:25,780
Hekk jagħmilha bażikament kostanti.

614
00:33:25,780 --> 00:33:29,150
Bħal inserzjoni u Lookup
huma bażikament ta 'żmien kostanti.

615
00:33:29,150 --> 00:33:33,750
>> Hekk jekk inti tista 'qatt tikseb
xi ħaġa fil-ħin kostanti,

616
00:33:33,750 --> 00:33:35,150
li bħala tajba kif jiġrilha.

617
00:33:35,150 --> 00:33:37,990
Inti ma tistax tikseb aħjar minn
ħin kostanti għal dawn l-affarijiet.

618
00:33:37,990 --> 00:33:43,150
Allura dan huwa wieħed mill-
pluses kbar ta 'jipprova.

619
00:33:43,150 --> 00:33:46,780
>> Iżda huwa ħafna spazju.

620
00:33:46,780 --> 00:33:50,380
Allura inti tip ta 'għandek tiddeċiedi
x'hemm aktar importanti għalik.

621
00:33:50,380 --> 00:33:54,700
U fuq il-kompjuters tal-lum, il-
ispazju li jipprova jista 'jieħu

622
00:33:54,700 --> 00:33:57,740
forsi ma jaffettwax
inti li ħafna, imma forsi

623
00:33:57,740 --> 00:34:01,350
int jittrattaw ma 'xi ħaġa
li għandha ħafna, ferm aktar affarijiet,

624
00:34:01,350 --> 00:34:02,810
u jipprova biss mhuwiex raġonevoli.

625
00:34:02,810 --> 00:34:03,000
Iva?

626
00:34:03,000 --> 00:34:05,610
>> UDJENZA: Stenna, hekk ikollok 26
ittri f'kull wieħed wieħed?

627
00:34:05,610 --> 00:34:07,440
>> SPEAKER 1: Mmhmm.

628
00:34:07,440 --> 00:34:08,570
Yeah, inti għandek 26.

629
00:34:08,570 --> 00:34:16,984
Inti għandek xi hija markatur kelma u mbagħad
għandek 26 pointers f'kull wieħed.

630
00:34:16,984 --> 00:34:17,775
U dawn qed point--

631
00:34:17,775 --> 00:34:20,280
>> UDJENZA: U kull 26,
ma għandhom kull wieħed ikollhom 26?

632
00:34:20,280 --> 00:34:21,500
>> SPEAKER 1: Iva.

633
00:34:21,500 --> 00:34:27,460
U hu għalhekk li, kif inti tista '
tara, hija tespandi pjuttost malajr.

634
00:34:27,460 --> 00:34:28,130
Kull dritt.

635
00:34:28,130 --> 00:34:32,524
Allura aħna qed tmur biex tikseb fis-siġar, li
Inħoss bħal huwa aktar faċli u probabbilment se

636
00:34:32,524 --> 00:34:36,150
jkun reprieve ftit sbieħ
minn jipprova hemmhekk.

637
00:34:36,150 --> 00:34:39,620
Hekk nisperaw ħafna minnkom
raw siġra qabel.

638
00:34:39,620 --> 00:34:41,820
Mhux bħall-pretty
dawk barra, li jiena

639
00:34:41,820 --> 00:34:44,340
ma nafx jekk xi ħadd
marru barra reċentement.

640
00:34:44,340 --> 00:34:49,230
I marru tuffieħ picking dan il-weekend,
u oh gosh tiegħi, kien sbieħ.

641
00:34:49,230 --> 00:34:52,250
Ma kontx naf weraq
tista 'tfittex li pretty.

642
00:34:52,250 --> 00:34:53,610
>> Allura din hija biss siġra, id-dritt?

643
00:34:53,610 --> 00:34:56,790
Huwa biss xi node, u
punti li mazz ta 'punti strateġiċi oħrajn.

644
00:34:56,790 --> 00:34:59,570
Kif qed taraw hawn, dan huwa
tip ta 'tema rikorrenti.

645
00:34:59,570 --> 00:35:03,720
Lymph tipponta lejn lymph huwa tip ta '
l-essenza ta 'strutturi ta' dejta ħafna.

646
00:35:03,720 --> 00:35:06,670
Hija biss tiddependi fuq kif aħna
jkollhom magħhom jippuntaw lejn xulxin

647
00:35:06,670 --> 00:35:08,600
u kif aħna travers
permezz tagħhom u kif aħna

648
00:35:08,600 --> 00:35:14,500
daħħal affarijiet li jiddetermina
karatteristiċi differenti tagħhom.

649
00:35:14,500 --> 00:35:17,600
>> Hekk biss xi terminoloġija,
li stajt użati qabel.

650
00:35:17,600 --> 00:35:20,010
Allura għeruq huwa dak kollu li huwa fil-quċċata ħafna.

651
00:35:20,010 --> 00:35:21,200
huwa fejn aħna dejjem tibda.

652
00:35:21,200 --> 00:35:23,610
Inti tista 'taħseb li bħala l-kap wkoll.

653
00:35:23,610 --> 00:35:28,750
Iżda għas-siġar, għandna t-tendenza li
jirreferu għaliha bħala l-għerq.

654
00:35:28,750 --> 00:35:32,820
>> Xejn fil-here-- qiegħ
fil-ħafna, ħafna bottom--

655
00:35:32,820 --> 00:35:34,500
huma weraq kkunsidrati.

656
00:35:34,500 --> 00:35:37,210
Għalhekk tmur flimkien mal-
ħaġa sħiħa siġra, id-dritt?

657
00:35:37,210 --> 00:35:39,860
Weraq huma fit-truf tal siġra tiegħek.

658
00:35:39,860 --> 00:35:45,820
>> U allura aħna wkoll jkollhom koppja ta '
termini li jitkellmu dwar lymph fir-rigward

659
00:35:45,820 --> 00:35:46,680
lil xulxin.

660
00:35:46,680 --> 00:35:49,700
Allura aħna għandna ġenitur,
tfal, u l-aħwa.

661
00:35:49,700 --> 00:35:56,260
Allura f'dan il-każ, 3 huwa l-
ġenitur ta '5, 6, u 7.

662
00:35:56,260 --> 00:36:00,370
Allura l-ġenitur huwa dak kollu li huwa
pass wieħed hawn fuq x'ikun int

663
00:36:00,370 --> 00:36:02,940
jirreferu għal, hekk biss
bħal siġra tal-familja.

664
00:36:02,940 --> 00:36:07,090
Nisperaw, din hija kollha ftit
ftit aktar intuwittivi mill-jipprova.

665
00:36:07,090 --> 00:36:10,970
>> Aħwa huma xi li jkollhom
l-istess ġenitur, id-dritt?

666
00:36:10,970 --> 00:36:13,470
Huma qed fuq l-istess livell hawn.

667
00:36:13,470 --> 00:36:16,960
U mbagħad, kif kien
qal, tfal huma biss

668
00:36:16,960 --> 00:36:22,630
dak kollu li huwa pass wieħed taħt
l-node in kwistjoni, OK?

669
00:36:22,630 --> 00:36:23,470
Kessaħ.

670
00:36:23,470 --> 00:36:25,610
Allura siġra binarju.

671
00:36:25,610 --> 00:36:31,450
Jista 'xi ħadd periklu raden fuq waħda mill
il-karatteristiċi tas-siġra binarju?

672
00:36:31,450 --> 00:36:32,770
>> UDJENZA: Max żewġ werqiet.

673
00:36:32,770 --> 00:36:33,478
>> SPEAKER 1: Dritt.

674
00:36:33,478 --> 00:36:34,640
Allura max ta 'żewġ werqiet.

675
00:36:34,640 --> 00:36:39,730
Allura f'dan il-wieħed qabel, kellna dan wieħed
li kellhom tlieta, iżda fil-siġra binarju,

676
00:36:39,730 --> 00:36:45,000
għandek max ta 'żewġ
tfal għal kull ġenitur, id-dritt?

677
00:36:45,000 --> 00:36:46,970
Hemm ieħor
karatteristika interessanti.

678
00:36:46,970 --> 00:36:51,550
Ħadd ma jaf li?

679
00:36:51,550 --> 00:36:52,620
Siġra binarju.

680
00:36:52,620 --> 00:37:00,350
>> Allura siġra binarju se jkollhom kollox
fuq the-- dan huwa wieħed mhux sorted--

681
00:37:00,350 --> 00:37:05,320
iżda fil-siġra binarju magħżula,
kollox fuq il-lemin

682
00:37:05,320 --> 00:37:08,530
huwa akbar mill-ġenitur,
u kollox fuq ix-xellug

683
00:37:08,530 --> 00:37:10,035
huwa inqas mill-ġenitur.

684
00:37:10,035 --> 00:37:15,690
U li kien kwizz
kwistjoni qabel, hekk tajjeb li tkun taf.

685
00:37:15,690 --> 00:37:19,500
Allura l-mod kif aħna jiddefinixxu dan,
għal darb'oħra, għandna node ieħor.

686
00:37:19,500 --> 00:37:21,880
Dan jidher simili ħafna għal dak?

687
00:37:21,880 --> 00:37:28,336

688
00:37:28,336 --> 00:37:28,836
Doppjament

689
00:37:28,836 --> 00:37:29,320
>> Udjenza: Marbuta listi

690
00:37:29,320 --> 00:37:31,100
>> SPEAKER 1: Lista marbuta doppja, id-dritt?

691
00:37:31,100 --> 00:37:33,690
Hekk jekk aħna nissostitiwxxu din
ma preċedenti u li jmiss,

692
00:37:33,690 --> 00:37:35,670
dan ikun lista marbuta doppjament.

693
00:37:35,670 --> 00:37:40,125
Iżda f'dan il-każ, aħna fil-fatt
jkollhom xellug u lemin u li hu.

694
00:37:40,125 --> 00:37:41,500
Inkella, huwa eżattament l-istess.

695
00:37:41,500 --> 00:37:43,374
Aħna xorta jkollhom l-element
inti qed tfittex,

696
00:37:43,374 --> 00:37:45,988
u inti biss għandek żewġ pointers
ser ikun x'ikun jmiss.

697
00:37:45,988 --> 00:37:49,210

698
00:37:49,210 --> 00:37:51,870
Yeah, siġra tfittxija hekk binarju.

699
00:37:51,870 --> 00:37:57,665
Jekk aħna Avviż, kollox fuq il-
dritt hawnhekk hija than-- akbar

700
00:37:57,665 --> 00:37:59,850
jew kollox immedjatament
lejn il-lemin hawn

701
00:37:59,850 --> 00:38:02,840
huwa akbar minn, dak kollu
hawnhekk huwa inqas minn.

702
00:38:02,840 --> 00:38:06,980

703
00:38:06,980 --> 00:38:14,000
>> Hekk jekk konna biex tfittex permezz, dan
għandha tfittex qrib ħafna tfittxija binarju

704
00:38:14,000 --> 00:38:14,910
hawn, id-dritt?

705
00:38:14,910 --> 00:38:17,640
Ħlief minflok tfittex
fuq nofs il-firxa,

706
00:38:17,640 --> 00:38:21,720
aħna qed biss tħares lejn jew ix-xellug
ġenb jew il-lemin tas-siġra.

707
00:38:21,720 --> 00:38:24,850
Hekk jiġrilha ftit aktar sempliċi, I think.

708
00:38:24,850 --> 00:38:29,300
>> Hekk jekk għerq tiegħek huwa NULL,
ovvjament huwa biss falza.

709
00:38:29,300 --> 00:38:33,470
U jekk huwa hemmhekk, ovvjament huwa veru.

710
00:38:33,470 --> 00:38:35,320
Jekk huwa inqas minn, aħna tfittxija ix-xellug.

711
00:38:35,320 --> 00:38:37,070
Jekk huwa akbar minn,
aħna tfittxija fuq il-lemin.

712
00:38:37,070 --> 00:38:39,890
Huwa eżattament bħall tfittxija binarja,
biss struttura differenti data

713
00:38:39,890 --> 00:38:40,600
li aħna qed jużaw.

714
00:38:40,600 --> 00:38:42,790
Minflok firxa,
huwa biss siġra binarju.

715
00:38:42,790 --> 00:38:45,820

716
00:38:45,820 --> 00:38:48,090
>> OK, stacks.

717
00:38:48,090 --> 00:38:51,550
U wkoll, jidher qisu aħna
jista 'jkollhom xi ftit ta' żmien.

718
00:38:51,550 --> 00:38:54,460
Jekk nagħmlu, jien kuntent li jmorru
fuq kwalunkwe ta 'dan mill-ġdid.

719
00:38:54,460 --> 00:38:56,856
OK, hekk stacks.

720
00:38:56,856 --> 00:39:02,695
Hawn xi ħadd ftakar dak stacks--
kwalunkwe karatteristika ta 'ċumnija?

721
00:39:02,695 --> 00:39:05,550

722
00:39:05,550 --> 00:39:10,400
>> OK, hekk ħafna minna, I think,
jieklu fil-dining halls--

723
00:39:10,400 --> 00:39:13,100
kemm aħna ma tista 'tixtieq li.

724
00:39:13,100 --> 00:39:16,900
Imma ovvjament, inti tista 'taħseb ta' munzell
litteralment biss bħala munzell ta 'dixxijiet

725
00:39:16,900 --> 00:39:18,460
jew munzell ta 'affarijiet.

726
00:39:18,460 --> 00:39:21,820
U x'hemm importanti
li tirrealizza hija li huwa

727
00:39:21,820 --> 00:39:26,850
something-- il-karatteristika
li aħna sejħa hija by-- huwa LIFO.

728
00:39:26,850 --> 00:39:28,450
Hawn xi ħadd jaf liema li stands għall?

729
00:39:28,450 --> 00:39:29,070
Mmhmm?

730
00:39:29,070 --> 00:39:30,650
>> UDJENZA: L-aħħar fl-ewwel out.

731
00:39:30,650 --> 00:39:32,250
>> SPEAKER 1: Dritt, l-aħħar fl-ewwel out.

732
00:39:32,250 --> 00:39:36,585
Hekk jekk nafu, jekk aħna qed istivar affarijiet
up, l-eħfef ħaġa li grab off--

733
00:39:36,585 --> 00:39:39,570
u forsi l-unika ħaġa li nistgħu grab
off jekk munzell tagħna huwa enough-- big

734
00:39:39,570 --> 00:39:40,850
huwa dak l-element top.

735
00:39:40,850 --> 00:39:43,460
Sabiex ikun x'ikun tpoġġa fuq
last-- kif naraw hawn,

736
00:39:43,460 --> 00:39:46,370
ikun x'ikun kien imbuttat
fuq l-aktar recently-- huwa

737
00:39:46,370 --> 00:39:51,160
se tkun l-ewwel
ħaġa li aħna pop off, OK?

738
00:39:51,160 --> 00:39:56,324
>> Allura dak li għandna hawnhekk huwa
Struct typedef ieħor.

739
00:39:56,324 --> 00:39:58,740
Dan huwa verament biss bħal
crash kors fl-istruttura tad-data,

740
00:39:58,740 --> 00:40:01,650
hekk hemm ħafna jintefgħu fil int guys.

741
00:40:01,650 --> 00:40:02,540
I know.

742
00:40:02,540 --> 00:40:04,970
Allura għadhom Struct ieħor.

743
00:40:04,970 --> 00:40:06,740
Yay għal strutturi.

744
00:40:06,740 --> 00:40:16,660
>> U f'dan il-każ, huwa xi pointer
għal firxa li għandha xi kapaċità.

745
00:40:16,660 --> 00:40:20,830
Allura dan jirrappreżenta munzell tagħna
hawn, bħal firxa attwali tagħna

746
00:40:20,830 --> 00:40:22,520
thats azjenda elementi tagħna.

747
00:40:22,520 --> 00:40:24,850
U allura hawnhekk għandna xi daqs.

748
00:40:24,850 --> 00:40:31,170
>> U tipikament, inti tixtieq li żżomm
rekord ta 'kemm hu kbir munzell tiegħek huwa

749
00:40:31,170 --> 00:40:36,180
għaliex dak li għaddej biex jippermettu
inti tagħmel hija jekk inti taf l-daqs,

750
00:40:36,180 --> 00:40:39,170
din tippermetti li inti tgħid,
OK, I am fil-kapaċità?

751
00:40:39,170 --> 00:40:40,570
Nista żid xejn aktar?

752
00:40:40,570 --> 00:40:44,650
U wkoll jgħidlek
fejn il-quċċata tal-munzell tiegħek

753
00:40:44,650 --> 00:40:48,180
huwa sabiex inti tkun taf dak li inti
jistgħu attwalment tluq.

754
00:40:48,180 --> 00:40:51,760
U li fil-fatt se
jkun ftit aktar ċara hawn.

755
00:40:51,760 --> 00:40:57,350
>> Allura għal push, ħaġa waħda, jekk inti
kienu qatt biex jimplimentaw timbotta,

756
00:40:57,350 --> 00:41:01,330
kif I kien biss qal, tiegħek
munzell għandu daqs limitat, id-dritt?

757
00:41:01,330 --> 00:41:03,990
Firxa tagħna kellhom xi kapaċità.

758
00:41:03,990 --> 00:41:04,910
Huwa ta 'firxa.

759
00:41:04,910 --> 00:41:08,930
Huwa daqs fiss, għalhekk għandna bżonn li
kun żgur li aħna mhux qed tqegħid aktar

760
00:41:08,930 --> 00:41:11,950
fis firxa tagħna minn aħna
attwalment ikollhom spazju għall.

761
00:41:11,950 --> 00:41:16,900
>> Allura meta int ħolqien push
funzjoni, l-ewwel ħaġa li għandek tagħmel hu ngħidu aħna, OK,

762
00:41:16,900 --> 00:41:18,570
għandi spazju fil munzell tiegħi?

763
00:41:18,570 --> 00:41:23,330
Għaliex jekk jien ma, sorry,
I ma jista 'jaħżen element tiegħek.

764
00:41:23,330 --> 00:41:28,980
Jekk I do, imbagħad inti tixtieq li taħżen
huwa fil-quċċata tal-munzell, id-dritt?

765
00:41:28,980 --> 00:41:31,325
>> U dan huwa għaliex għandna
li jżommu rekord ta 'daqs tagħna.

766
00:41:31,325 --> 00:41:35,290
Jekk aħna ma jżommu rekord ta 'daqs tagħna,
ma nafux fejn li tqiegħed lilha.

767
00:41:35,290 --> 00:41:39,035
Aħna ma nafx kif ħafna affarijiet
huma fil-firxa tagħna diġà.

768
00:41:39,035 --> 00:41:41,410
Bħal ovvjament hemm modi
li forsi inti tista 'tagħmel dan.

769
00:41:41,410 --> 00:41:44,610
Inti tista initialize kollox biex NULL
u mbagħad tiċċekkja għall-aħħar NULL,

770
00:41:44,610 --> 00:41:47,950
imma ħaġa ferm aktar faċli huwa biss
ngħid, OK, jżommu rekord ta 'daqs.

771
00:41:47,950 --> 00:41:51,840
Like I know I jkollhom erba 'elementi
fil-firxa tiegħi, sabiex il-ħaġa li jmiss

772
00:41:51,840 --> 00:41:55,930
li nitfgħu fuq, aħna qed
ser taħżen bl-indiċi 4.

773
00:41:55,930 --> 00:42:00,940
U allura, ovvjament, dan ifisser li
inti stajt imbuttat b'suċċess xi ħaġa

774
00:42:00,940 --> 00:42:03,320
fuq munzell tiegħek, inti
tixtieq li jiżdied id-daqs

775
00:42:03,320 --> 00:42:08,880
sabiex tkun taf fejn inti hekk
li inti tista timbotta aktar affarijiet fuq.

776
00:42:08,880 --> 00:42:12,730
>> Hekk jekk aħna qed jippruvaw pop
xi ħaġa off-munzell,

777
00:42:12,730 --> 00:42:16,072
x'jista 'jkun l-ewwel ħaġa
li aħna rridu li jikkontrolla għal?

778
00:42:16,072 --> 00:42:18,030
Inti qed tipprova tieħu
xi ħaġa off munzell tiegħek.

779
00:42:18,030 --> 00:42:21,710

780
00:42:21,710 --> 00:42:24,781
Inti żgur hemm
xi ħaġa fil munzell tiegħek?

781
00:42:24,781 --> 00:42:25,280
No

782
00:42:25,280 --> 00:42:26,894
Allura dak li jista rridu li jivverifika?

783
00:42:26,894 --> 00:42:27,810
>> UDJENZA: [inaudible].

784
00:42:27,810 --> 00:42:29,880
SPEAKER 1: Iċċekkja għad-daqs?

785
00:42:29,880 --> 00:42:31,840
Daqs.

786
00:42:31,840 --> 00:42:38,520
Hekk irridu tikkontrolla biex tara jekk
Daqs tagħna huwa akbar minn 0, OK?

787
00:42:38,520 --> 00:42:44,970
U jekk huwa, allura aħna rridu li jonqos
Daqs tagħna ta '0 u ritorn dak.

788
00:42:44,970 --> 00:42:45,840
Għaliex?

789
00:42:45,840 --> 00:42:49,950
>> Fl-ewwel waħda konna
imbuttar, aħna imbuttat dan

790
00:42:49,950 --> 00:42:52,460
fuq id-daqs u d-daqs mbagħad aġġornati.

791
00:42:52,460 --> 00:42:57,850
F'dan il-każ, aħna qed decrementing daqs
u mbagħad tieħu off, qlugħ

792
00:42:57,850 --> 00:42:58,952
minn firxa tagħna.

793
00:42:58,952 --> 00:42:59,826
Għaliex jista nagħmlu dan?

794
00:42:59,826 --> 00:43:04,800

795
00:43:04,800 --> 00:43:11,811
Mela jekk ikolli ħaġa waħda fuq munzell tiegħi,
dak li jkun daqs tiegħi f'dak il-punt?

796
00:43:11,811 --> 00:43:13,140
1.

797
00:43:13,140 --> 00:43:15,180
>> U fejn tkun element 1 maħżuna?

798
00:43:15,180 --> 00:43:17,621
Fuq liema indiċi?

799
00:43:17,621 --> 00:43:18,120
UDJENZA: 0.

800
00:43:18,120 --> 00:43:19,060
SPEAKER 1: 0.

801
00:43:19,060 --> 00:43:22,800
Allura f'dan il-każ, aħna
dejjem bżonn tagħmel sure--

802
00:43:22,800 --> 00:43:27,630
minflok jirritornaw
daqs minus 1, għaliex aħna

803
00:43:27,630 --> 00:43:31,730
jafu li l-element tagħna huwa
ser jiġi maħżun fl-1 inqas

804
00:43:31,730 --> 00:43:34,705
irrispettivament mid-daqs tagħna huwa, dan
biss jieħu kura ta 'dan.

805
00:43:34,705 --> 00:43:36,080
Huwa mod ftit aktar eleganti.

806
00:43:36,080 --> 00:43:41,220
U aħna biss decrement tagħna
daqs u mbagħad daqs jirritornaw.

807
00:43:41,220 --> 00:43:42,330
Mmhmm?

808
00:43:42,330 --> 00:43:45,300
>> UDJENZA: I raden biss b'mod ġenerali,
għaliex kieku din l-istruttura tad-data

809
00:43:45,300 --> 00:43:47,800
tkun ta 'benefiċċju?

810
00:43:47,800 --> 00:43:50,660
>> SPEAKER 1: Hija tiddependi fuq il-kuntest tiegħek.

811
00:43:50,660 --> 00:43:57,420
Allura għal xi wħud mill-teorija,
jekk inti qed jaħdmu with-- OK,

812
00:43:57,420 --> 00:44:02,750
let me ara jekk ikun hemm wieħed benefiċċju
li huwa ta 'benefiċċju għal aktar minn barra

813
00:44:02,750 --> 00:44:05,420
ta 'CS.

814
00:44:05,420 --> 00:44:15,780
Bil stacks, kwalunkwe ħin għandek bżonn
li jżommu rekord ta 'xi ħaġa li

815
00:44:15,780 --> 00:44:20,456
huwa l-aktar reċentement miżjud huwa meta
int ser jridu jużaw munzell.

816
00:44:20,456 --> 00:44:24,770
>> U ma nistax think ta 'tajba
Eżempju ta 'dan id-dritt issa.

817
00:44:24,770 --> 00:44:29,955
Imma kull darba li l-aktar reċenti
ħaġa hija aktar importanti għalik,

818
00:44:29,955 --> 00:44:31,705
li meta munzell
se tkun utli.

819
00:44:31,705 --> 00:44:35,797

820
00:44:35,797 --> 00:44:39,330
Jien jippruvaw biex jaħsbu jekk
hemm waħda tajba għal dan.

821
00:44:39,330 --> 00:44:43,720
Jekk I think ta 'eżempju tajjeb fil-li jmiss
20 minuta, I definittivament se jgħidlek.

822
00:44:43,720 --> 00:44:49,455
>> Iżda b'mod ġenerali, jekk hemm xi ħaġa,
bħal I said aktar, fejn l-aktar reċenti

823
00:44:49,455 --> 00:44:52,470
huwa l-aktar importanti, thats
fejn munzell tidħol fis-play.

824
00:44:52,470 --> 00:44:58,860
Billi kjuwijiet huma tip ta 'l-oppost.

825
00:44:58,860 --> 00:44:59,870
U l-klieb ftit.

826
00:44:59,870 --> 00:45:00,890
Huwa ma 'dan kbira, id-dritt?

827
00:45:00,890 --> 00:45:03,299
Inħoss bħal I għandhom
biss ikollhom video bunny

828
00:45:03,299 --> 00:45:05,090
lemin fin-nofs ta '
taqsima għalik guys

829
00:45:05,090 --> 00:45:08,870
minħabba li din hija sezzjoni intensa.

830
00:45:08,870 --> 00:45:10,480
>> Hekk kju.

831
00:45:10,480 --> 00:45:12,710
Bażikament kju huwa bħal linja.

832
00:45:12,710 --> 00:45:15,780
You guys jien użu ċert li din ta 'kuljum,
eżatt bħal fil swali dining tagħna.

833
00:45:15,780 --> 00:45:18,160
Allura aħna għandna biex tmur fil-
u jiksbu trejs tagħna, jien

834
00:45:18,160 --> 00:45:21,260
żgur inti għandek tistenna fil-linja
swipe jew tikseb l-ikel tiegħek.

835
00:45:21,260 --> 00:45:24,650
>> Allura l-differenza hawn
hija li dan huwa FIFO.

836
00:45:24,650 --> 00:45:30,090
Hekk jekk LIFO kienet l-aħħar fl-ewwel
out, FIFO huwa l-ewwel fl-ewwel out.

837
00:45:30,090 --> 00:45:33,400
Allura dan huwa fejn kwalunkwe inti tpoġġi
fuq l-ewwel huwa tiegħek aktar importanti.

838
00:45:33,400 --> 00:45:35,540
Mela jekk inti kienu qed jistennew
fil line-- tista 'inti

839
00:45:35,540 --> 00:45:39,130
jimmaġina jekk inti marru biex
mur jiksbu l-iPhone ġodda

840
00:45:39,130 --> 00:45:42,800
u kien munzell fejn il-
aħħar persuna fil-linja ltqajna ewwel,

841
00:45:42,800 --> 00:45:44,160
nies se joqtlu lil xulxin.

842
00:45:44,160 --> 00:45:49,800
>> Allura FIFO, aħna qed kollha familjari ħafna
mal fid-dinja reali hawnhekk,

843
00:45:49,800 --> 00:45:54,930
u dan kollu għandu ma 'attwalment
tip ta 'recreating din il-linja kollu

844
00:45:54,930 --> 00:45:56,900
u queuing istruttura.

845
00:45:56,900 --> 00:46:02,390
Allura billi mal-munzell,
għandna push u pop.

846
00:46:02,390 --> 00:46:06,440
Bil-kju, għandna
enqueue u dequeue.

847
00:46:06,440 --> 00:46:10,910
Allura enqueue bażikament ifisser
poġġih fuq id-dahar,

848
00:46:10,910 --> 00:46:13,680
u mezzi dequeue tieħu
off minn quddiem.

849
00:46:13,680 --> 00:46:18,680
Allura istruttura tad-data tagħna huwa
ftit aktar ikkumplikata.

850
00:46:18,680 --> 00:46:21,060
Għandna t-tieni ħaġa li jżommu rekord ta.

851
00:46:21,060 --> 00:46:25,950
>> Allura mingħajr ir-ras, din
huwa eżattament munzell, id-dritt?

852
00:46:25,950 --> 00:46:27,900
Dan huwa l-istess struttura bħal munzell.

853
00:46:27,900 --> 00:46:32,480
L-unika ħaġa differenti issa hija aħna
jkollhom dan il-kap, li x'taħseb

854
00:46:32,480 --> 00:46:34,272
se jżommu rekord ta '?

855
00:46:34,272 --> 00:46:35,510
>> UDJENZA: L-ewwel wieħed.

856
00:46:35,510 --> 00:46:38,685
>> SPEAKER 1: Dritt, il-
ewwel ħaġa li nitfgħu fl.

857
00:46:38,685 --> 00:46:41,130
Il-kap tal-kju tagħna.

858
00:46:41,130 --> 00:46:42,240
Kulmin huwa l-ewwel fil-linja.

859
00:46:42,240 --> 00:46:45,300

860
00:46:45,300 --> 00:46:49,420
Kull dritt, hekk jekk nagħmlu enqueue.

861
00:46:49,420 --> 00:46:52,720

862
00:46:52,720 --> 00:46:55,920
Għal darb'oħra, ma 'xi
dawn l-istrutturi tad-data,

863
00:46:55,920 --> 00:46:59,760
peress li aħna qed jittrattaw ma 'firxa,
għandna bżonn li jiċċekkja jekk ikollna spazju.

864
00:46:59,760 --> 00:47:03,290
>> Dan huwa tip simili me javżak
inti guys, jekk inti tiftaħ fajl,

865
00:47:03,290 --> 00:47:04,760
għandek bżonn sabiex jikkontrolla għal null.

866
00:47:04,760 --> 00:47:08,330
Ma 'kwalunkwe minn dawn stacks
u kjuwijiet, inti għandek bżonn

867
00:47:08,330 --> 00:47:13,420
biex tara jekk hemm spazju għax aħna qed
jittrattaw ma 'firxa daqs fiss,

868
00:47:13,420 --> 00:47:16,030
kif naraw here-- 0, 1 kollha sa 5.

869
00:47:16,030 --> 00:47:20,690
Allura dak li nagħmlu fil-każ hija verifika
biex tara jekk aħna xorta jkollhom spazju.

870
00:47:20,690 --> 00:47:23,110
Huwa d-daqs tagħna inqas minn kapaċità?

871
00:47:23,110 --> 00:47:28,480
>> Jekk iva, għandna bżonn li jaħżinha bir
il-denb u aħna aġġornament daqs tagħna.

872
00:47:28,480 --> 00:47:30,250
Allura dak li jista 'jkun l-denb f'dan il-każ?

873
00:47:30,250 --> 00:47:32,360
Mhuwiex espliċitament miktub.

874
00:47:32,360 --> 00:47:33,380
Kif aħna taħżen dan?

875
00:47:33,380 --> 00:47:34,928
Liema jkun l-denb tkun?

876
00:47:34,928 --> 00:47:38,600

877
00:47:38,600 --> 00:47:40,190
>> Mela ejja jimxu permezz ta dan l-eżempju.

878
00:47:40,190 --> 00:47:44,590
Allura dan huwa firxa ta 'daqs 6, id-dritt?

879
00:47:44,590 --> 00:47:49,220
U għandna d-dritt issa, id-daqs tagħna hija ta '5.

880
00:47:49,220 --> 00:47:55,240
U meta aħna poġġih fil, li għaddej
li jmorru fil-ħames indiċi, id-dritt?

881
00:47:55,240 --> 00:47:57,030
Allura jaħżen fil denb.

882
00:47:57,030 --> 00:48:05,600
>> Mod ieħor biex jiktbu denb kien biss
jkun array tagħna fuq indiċi tad-daqs, id-dritt?

883
00:48:05,600 --> 00:48:07,560
Dan huwa d-daqs 5.

884
00:48:07,560 --> 00:48:11,490
Ħaġa li jmiss se jmorru fil-5.

885
00:48:11,490 --> 00:48:12,296
Kessaħ?

886
00:48:12,296 --> 00:48:13,290
OK.

887
00:48:13,290 --> 00:48:16,350
Jiġrilha ftit aktar kumplikata
meta nibdew messing mal-kap.

888
00:48:16,350 --> 00:48:17,060
Iva?

889
00:48:17,060 --> 00:48:20,090
>> UDJENZA: Dan ifisser li aħna
kien iddikjara firxa li

890
00:48:20,090 --> 00:48:23,880
kien ta 'ħames elementi twil u
allura aħna qed żżid fuq dan?

891
00:48:23,880 --> 00:48:24,730
>> SPEAKER 1: No

892
00:48:24,730 --> 00:48:27,560
Allura f'dan il-każ, dan huwa munzell.

893
00:48:27,560 --> 00:48:31,760
Dan ikun dikjarat
bħala firxa ta 'daqs 6.

894
00:48:31,760 --> 00:48:37,120
U f'dan il-każ, aħna
biss ikollhom spazju wieħed xellug.

895
00:48:37,120 --> 00:48:42,720
>> OK, hekk ħaġa waħda hija f'din
każ, jekk ewlieni tagħna huwa ta '0,

896
00:48:42,720 --> 00:48:45,270
allura aħna biss tista 'żżid fil-daqs.

897
00:48:45,270 --> 00:48:51,020
Iżda jiġrilha ftit delikati
għaliex fil-fatt, huma

898
00:48:51,020 --> 00:48:52,840
ma jkollhomx slide
għal dan, hekk jien ser

899
00:48:52,840 --> 00:48:56,670
tiġbed waħda għaliex mhuwiex
pjuttost li sempliċi ladarba inti

900
00:48:56,670 --> 00:48:59,230
tibda jwarrbu ta 'affarijiet.

901
00:48:59,230 --> 00:49:03,920
Allura billi ma munzell
inti biss qatt

902
00:49:03,920 --> 00:49:08,920
biex joqogħdu jinkwetaw dwar dak id-daqs huwa
meta int żżid xi ħaġa fuq,

903
00:49:08,920 --> 00:49:15,710
bil kju għandek bżonn ukoll li tagħmel
żgur li l-kap tiegħek hi ġġustifikata,

904
00:49:15,710 --> 00:49:20,760
għaliex ħaġa jibred dwar kjuwijiet
hija li jekk int ma fil-kapaċità,

905
00:49:20,760 --> 00:49:23,040
inti tista 'attwalment jagħmilha around.

906
00:49:23,040 --> 00:49:28,810
>> OK, hekk wieħed thing-- oh,
dan huwa ġibs terribbli.

907
00:49:28,810 --> 00:49:31,815
Ħaġa waħda li wieħed għandu jikkonsidra huwa l-każ.

908
00:49:31,815 --> 00:49:35,514

909
00:49:35,514 --> 00:49:37,140
Aħna ser biss tagħmel ħamsa.

910
00:49:37,140 --> 00:49:41,810
OK, hekk aħna qed tmur biex
jiġifieri l-ras hija hawnhekk.

911
00:49:41,810 --> 00:49:46,140
Dan huwa ta '0, 1, 2, 3, 4.

912
00:49:46,140 --> 00:49:54,210
>> Il-kap hemm, u
jekk jogħġbok jkollhom affarijiet fihom.

913
00:49:54,210 --> 00:49:58,340
U rridu li żżid xi ħaġa fil, id-dritt?

914
00:49:58,340 --> 00:50:01,170
Allura l-ħaġa li għandna bżonn li
jafu hu li l-kap huwa dejjem

915
00:50:01,170 --> 00:50:05,620
ser jiċċaqalqu b'dan il-mod u
imbagħad loop lura madwar, OK?

916
00:50:05,620 --> 00:50:10,190
>> Allura dan kju għandha l-ispazju, id-dritt?

917
00:50:10,190 --> 00:50:13,950
Hija għandha spazju fil-bidu nett,
tip ta 'l-oppost ta' dan.

918
00:50:13,950 --> 00:50:17,920
Allura dak li għandna bżonn tagħmel hu li aħna
bżonn jikkalkulaw il-denb.

919
00:50:17,920 --> 00:50:20,530
Jekk taf li tiegħek
ras ma mxietx, denb

920
00:50:20,530 --> 00:50:24,630
huwa biss array tiegħek
l-indiċi tad-daqs.

921
00:50:24,630 --> 00:50:30,000
>> Iżda fir-realtà, jekk inti qed tuża kju,
kap tiegħek huwa probabbilment qed tiġi aġġornata.

922
00:50:30,000 --> 00:50:33,890
Allura dak li għandek bżonn tagħmel huwa
attwalment tikkalkula l-denb.

923
00:50:33,890 --> 00:50:39,990
Allura dak li nagħmlu hu din il-formula
hawn, li jien ser tavżak

924
00:50:39,990 --> 00:50:42,680
guys jaħsbu dwar, u
allura aħna ser nitkellmu dwar dan.

925
00:50:42,680 --> 00:50:49,567

926
00:50:49,567 --> 00:50:50,400
Allura dan huwa kapaċità.

927
00:50:50,400 --> 00:50:55,890

928
00:50:55,890 --> 00:50:59,660
>> Allura dan se attwalment
jagħtuk mod biex tagħmel dan.

929
00:50:59,660 --> 00:51:03,205

930
00:51:03,205 --> 00:51:04,330
Għaliex f'dan il-każ, liema?

931
00:51:04,330 --> 00:51:09,205
Ewlieni tagħna huwa fl-1, id-daqs tagħna huwa ta '4.

932
00:51:09,205 --> 00:51:11,760

933
00:51:11,760 --> 00:51:18,490
Jekk aħna MOD dik b'5, aħna nikseb 0,
li huwa fejn għandna input.

934
00:51:18,490 --> 00:51:23,320

935
00:51:23,320 --> 00:51:26,080
>> Hekk allura fil-każ li jmiss,
jekk konna biex jagħmlu dan,

936
00:51:26,080 --> 00:51:33,390
ngħidu, OK, ejja dequeue xi ħaġa.

937
00:51:33,390 --> 00:51:34,390
Aħna dequeue dan.

938
00:51:34,390 --> 00:51:37,740
Nieħdu out dan l-element, id-dritt?

939
00:51:37,740 --> 00:51:47,930
>> U issa ras tagħna hija li tipponta hawn,
u aħna tixtieq iżżid fil ħaġa oħra.

940
00:51:47,930 --> 00:51:52,470
Dan huwa bażikament l-
dahar tal-linja tagħna, id-dritt?

941
00:51:52,470 --> 00:51:55,450
Kjuwijiet tista wrap madwar il-firxa.

942
00:51:55,450 --> 00:51:57,310
Din kienet waħda mir-differenzi ewlenin.

943
00:51:57,310 --> 00:51:58,780
Stacks, inti ma tistax tagħmel dan.

944
00:51:58,780 --> 00:52:01,140
>> Bil kjuwijiet, inti tista
minħabba li l-kwistjonijiet

945
00:52:01,140 --> 00:52:03,940
hija li inti taf liema
ġie miżjud l-aktar reċentement.

946
00:52:03,940 --> 00:52:10,650
Peress li kollox se jiġi miżjud fil-
id-direzzjoni leftward, f'dan il-każ,

947
00:52:10,650 --> 00:52:16,480
u mbagħad wrap madwar, inti tista '
tkompli tqegħid fl-elementi ġodda

948
00:52:16,480 --> 00:52:18,830
fuq quddiem tal-firxa
għaliex mhuwiex verament

949
00:52:18,830 --> 00:52:20,640
quddiem tal-firxa jibqgħalu.

950
00:52:20,640 --> 00:52:26,320
Inti tista 'taħseb l-bidu tal-
array fejn ras tiegħek fil-fatt hu.

951
00:52:26,320 --> 00:52:29,710
>> Allura din il-formula huwa kif
inti tikkalkula denb tiegħek.

952
00:52:29,710 --> 00:52:32,780

953
00:52:32,780 --> 00:52:35,610
Does li jagħmel sens?

954
00:52:35,610 --> 00:52:36,110
OK.

955
00:52:36,110 --> 00:52:39,400

956
00:52:39,400 --> 00:52:44,040
OK, dequeue, u mbagħad
inti guys jkollhom 10 minuti

957
00:52:44,040 --> 00:52:48,840
li jistaqsu lili xi mistoqsijiet li tiċċara
trid, għaliex naf huwa crazy.

958
00:52:48,840 --> 00:52:51,980
>> Kull dritt, hekk fl-istess way--
I do not know jekk inti guys ndunat,

959
00:52:51,980 --> 00:52:53,450
iżda CS hija kollha dwar ix-xejriet.

960
00:52:53,450 --> 00:52:57,370
Affarijiet huma pjuttost l-
istess, biss ma tweaks ċkejkna.

961
00:52:57,370 --> 00:52:58,950
Allura istess ħaġa hawn.

962
00:52:58,950 --> 00:53:04,040
Għandna bżonn biex tikkontrolla biex tara jekk aħna fil-fatt
ikollhom xi ħaġa fil-kju tagħna, id-dritt?

963
00:53:04,040 --> 00:53:05,960
Say, OK, huwa d-daqs tagħna akbar minn 0?

964
00:53:05,960 --> 00:53:06,730
Kessaħ.

965
00:53:06,730 --> 00:53:10,690
>> Jekk nagħmlu, allura nimxu ras tagħna, li
huwa dak I biss murija hawn.

966
00:53:10,690 --> 00:53:13,870
Aħna aġġornament ras tagħna tkun waħda aktar.

967
00:53:13,870 --> 00:53:18,390
U allura aħna decrement tagħna
daqs u jirritorna l-element.

968
00:53:18,390 --> 00:53:21,000

969
00:53:21,000 --> 00:53:26,250
>> Hemm ħafna aktar konkret
kodiċi fuq study.cs50.net,

970
00:53:26,250 --> 00:53:29,440
u I jirrakkomanda ħafna li jmorru
permezz ta 'dan jekk ikollok ħin,

971
00:53:29,440 --> 00:53:30,980
anki jekk huwa biss a-kodiċi psewdo.

972
00:53:30,980 --> 00:53:35,980
U jekk inti guys trid titkellem permezz
li miegħi waħda fuq waħda, jekk jogħġbok let me

973
00:53:35,980 --> 00:53:37,500
jafu.

974
00:53:37,500 --> 00:53:38,770
I d jkunu kuntenti li.

975
00:53:38,770 --> 00:53:42,720
Strutturi ta 'dejta, jekk
tieħu CS 124, inti ser

976
00:53:42,720 --> 00:53:47,830
jafu li l-istrutturi tad-data jiksbu ħafna
gost u dan huwa biss bidu.

977
00:53:47,830 --> 00:53:50,350
>> So I know huwa diffiċli.

978
00:53:50,350 --> 00:53:51,300
Huwa OK.

979
00:53:51,300 --> 00:53:52,410
Aħna jissieltu.

980
00:53:52,410 --> 00:53:53,630
I still do.

981
00:53:53,630 --> 00:53:56,660
Sabiex ma joqogħdu jinkwetaw wisq dwar dan.

982
00:53:56,660 --> 00:54:02,390
>> Iżda li hija bażikament tiegħek
crash kors fl-istrutturi tad-data.

983
00:54:02,390 --> 00:54:03,400
Naf huwa ħafna.

984
00:54:03,400 --> 00:54:06,860
Hemm xi ħaġa li aħna
tixtieq li tmur aktar mill-ġdid?

985
00:54:06,860 --> 00:54:09,400
Xejn rridu nitkellmu permezz?

986
00:54:09,400 --> 00:54:10,060
Iva?

987
00:54:10,060 --> 00:54:16,525
>> UDJENZA: Għal dak eżempju, hekk
il-denb ġdida hija ta '0 fuq dak?

988
00:54:16,525 --> 00:54:17,150
SPEAKER 1: Iva.

989
00:54:17,150 --> 00:54:18,230
UDJENZA: OK.

990
00:54:18,230 --> 00:54:24,220
Mela allura għaddejjin,
youd għandek 1 plus 4 or--

991
00:54:24,220 --> 00:54:27,671
>> SPEAKER 1: Allura inti kienu jgħidu,
meta irridu imorru tagħmel dan mill-ġdid?

992
00:54:27,671 --> 00:54:28,296
UDJENZA: Yeah.

993
00:54:28,296 --> 00:54:38,290
Mela jekk inti kienu jidhru out-- fejn huma
inti kalkolu tal-denb minn fil-li?

994
00:54:38,290 --> 00:54:44,260
>> SPEAKER 1: Allura l-denb
kien in-- I mibdula din.

995
00:54:44,260 --> 00:54:52,010
Allura f'dan l-eżempju hawn, dan kien
l-array aħna qed tħares lejn, OK?

996
00:54:52,010 --> 00:54:54,670
Allura aħna għandna affarijiet fil-1, 2, 3, u 4.

997
00:54:54,670 --> 00:55:05,850
Allura aħna għandna ewlieni tagħna huwa ugwali għal 1 fil-
dan il-punt, u d-daqs tagħna huwa ugwali għal 4

998
00:55:05,850 --> 00:55:07,050
f'dan il-punt, id-dritt?

999
00:55:07,050 --> 00:55:08,960
>> Inti kollha jaqblu li huwa l-każ?

1000
00:55:08,960 --> 00:55:14,620
Allura nagħmlu l-kap plus-daqs, li
jagħtina 5, u allura aħna Mod b'5.

1001
00:55:14,620 --> 00:55:20,690
Nikbru 0, li tgħidilna li huwa 0
fejn huwa denb tagħna, fejn għandna l-ispazju.

1002
00:55:20,690 --> 00:55:22,010
>> UDJENZA: X'hemm għatu?

1003
00:55:22,010 --> 00:55:23,520
>> SPEAKER 1: Il-kapaċità.

1004
00:55:23,520 --> 00:55:24,020
Jiddispjacini.

1005
00:55:24,020 --> 00:55:29,640
Allura li huwa d-daqs ta 'firxa tiegħek.

1006
00:55:29,640 --> 00:55:35,210

1007
00:55:35,210 --> 00:55:36,047
Iva?

1008
00:55:36,047 --> 00:55:39,210
>> UDJENZA: [inaudible] qabel
nerġgħu lura l-element?

1009
00:55:39,210 --> 00:55:46,270
>> SPEAKER 1: Allura aħna nimxu l-
ras jew jirritornaw il-mument?

1010
00:55:46,270 --> 00:55:52,680
Hekk jekk nimxu wieħed, decrement-daqs?

1011
00:55:52,680 --> 00:55:54,150
Żomm fuq.

1012
00:55:54,150 --> 00:55:55,770
I definitely nesa ieħor.

1013
00:55:55,770 --> 00:56:00,646

1014
00:56:00,646 --> 00:56:01,990
Qatt f'moħħhom.

1015
00:56:01,990 --> 00:56:04,980
Ma jkunx hemm formula ieħor.

1016
00:56:04,980 --> 00:56:09,980
Yeah, inti tixtieq li jirritornaw
ir-ras u mbagħad jimxu lura.

1017
00:56:09,980 --> 00:56:13,270
>> UDJENZA: OK, għaliex Fuq dan
punt, il-kap kien ta '0,

1018
00:56:13,270 --> 00:56:18,452
u allura inti tixtieq li jirritornaw
indiċi 0 u mbagħad jagħmlu ras 1?

1019
00:56:18,452 --> 00:56:19,870
>> SPEAKER 1: Dritt.

1020
00:56:19,870 --> 00:56:22,820
Naħseb li hemm ieħor
formula tip ta 'bħal dan.

1021
00:56:22,820 --> 00:56:26,970
I ma jkollhomx dan fuq il-quċċata tar-ras tiegħi bħala
Ma rridx li jtik l-waħda ħażina.

1022
00:56:26,970 --> 00:56:35,470
Imma naħseb li huwa perfettament valida biex
jiġifieri, OK, taħżen din element-- x'ikun

1023
00:56:35,470 --> 00:56:40,759
element ras is-- decrement tiegħek
daqs, jimxu ras tiegħek fuq, u r-ritorn

1024
00:56:40,759 --> 00:56:41,800
kwalunkwe li element huwa.

1025
00:56:41,800 --> 00:56:44,760
C'est perfettament valida.

1026
00:56:44,760 --> 00:56:45,260
OK.

1027
00:56:45,260 --> 00:56:48,360

1028
00:56:48,360 --> 00:56:53,560
Inħoss bħal dan mhuwiex
bħall-most-- int ma

1029
00:56:53,560 --> 00:56:55,740
ser jimxu minn hawn
simili, iva, naf jipprova.

1030
00:56:55,740 --> 00:56:56,880
I ltqajna kollha.

1031
00:56:56,880 --> 00:56:57,670
C'est OK.

1032
00:56:57,670 --> 00:57:00,200
I wegħda.

1033
00:57:00,200 --> 00:57:05,240
Imma l-istrutturi tad-data huma xi ħaġa li
hija tieħu ħafna ħin biex jidraw.

1034
00:57:05,240 --> 00:57:10,010
Probabilment waħda mill-agħar
affarijiet, I think, fil-kors.

1035
00:57:10,010 --> 00:57:15,330
>> Allura huwa definittivament tieħu
ripetizzjoni u tfittex at-- I

1036
00:57:15,330 --> 00:57:20,050
ma verament jafu listi marbuta
sal I għamilt bogħod wisq magħhom,

1037
00:57:20,050 --> 00:57:22,550
bl-istess mod li għamilt ma
verament jifhem pointers

1038
00:57:22,550 --> 00:57:27,040
sal I kellna biex jgħallmu għal żewġ
snin u tagħmel psets tiegħi stess magħha.

1039
00:57:27,040 --> 00:57:28,990
Huwa jieħu ħafna ta 'tennija u l-ħin.

1040
00:57:28,990 --> 00:57:32,600
U eventwalment, se tip ta 'ikklikkja.

1041
00:57:32,600 --> 00:57:36,320
>> Iżda fil-frattemp, jekk għandek tip
ta 'fehim livell għoli ta' liema

1042
00:57:36,320 --> 00:57:39,321
dawn jagħmlu, punti favur
u cons-- li huwa dak

1043
00:57:39,321 --> 00:57:41,820
aħna verament tendenza li jenfasizzaw,
speċjalment fil-kors intro.

1044
00:57:41,820 --> 00:57:45,511
Bħal, għaliex kieku nużaw
jipprova fuq firxa?

1045
00:57:45,511 --> 00:57:48,010
Bħal, liema huma l-pożittivi
u negattivi ta 'kull wieħed minn dawk?

1046
00:57:48,010 --> 00:57:51,610
>> U jifhmu l-kompromessi
bejn kull wieħed minn dawn l-istrutturi

1047
00:57:51,610 --> 00:57:54,910
huwa dak ħafna aktar importanti dritt issa.

1048
00:57:54,910 --> 00:57:58,140
Jista 'jkun hemm wieħed crazy
kwistjoni jew tnejn li l-

1049
00:57:58,140 --> 00:58:03,710
ser jgħidlek biex jimplimentaw push jew
jimplimentaw pop jew enqueue u dequeue.

1050
00:58:03,710 --> 00:58:07,340
Iżda għall-parti l-kbira, li dak
fehim livell ogħla u aktar

1051
00:58:07,340 --> 00:58:09,710
ta 'ħakma intuwittivi huwa
aktar importanti milli fil-fatt

1052
00:58:09,710 --> 00:58:11,250
jkunu jistgħu jimplimentawha.

1053
00:58:11,250 --> 00:58:14,880
>> Huwa d jkun verament tal-biża jekk lilkom kollha
tista 'tmur out u jmorru jimplimentaw jipprova,

1054
00:58:14,880 --> 00:58:19,720
iżda aħna nifhmu mhuwiex neċessarjament
l-aktar ħaġa raġonevoli dritt issa.

1055
00:58:19,720 --> 00:58:23,370
Imma inti tista 'fil pset tiegħek, jekk inti tixtieq
għal, u allura inti ser tingħata prattika,

1056
00:58:23,370 --> 00:58:27,200
u mbagħad forsi inti taf
verament jifhmu dan.

1057
00:58:27,200 --> 00:58:27,940
Iva?

1058
00:58:27,940 --> 00:58:30,440
>> UDJENZA: OK, iva, liema huma
aħna maħsuba biex jużaw fil-pset?

1059
00:58:30,440 --> 00:58:31,916
Do I bżonn tuża wieħed minnhom?

1060
00:58:31,916 --> 00:58:32,540
SPEAKER 1: Iva.

1061
00:58:32,540 --> 00:58:34,199
Hekk ikollok l-għażla tiegħek.

1062
00:58:34,199 --> 00:58:36,740
I raden f'dan il-każ, nistgħu
jitkellmu dwar il-pset ftit

1063
00:58:36,740 --> 00:58:40,480
minħabba I dam permezz ta 'dawn.

1064
00:58:40,480 --> 00:58:47,779
Hekk fil pset tiegħek, inti għandek tiegħek
għażla ta 'tipprova jew tabelli hash.

1065
00:58:47,779 --> 00:58:49,570
Xi nies se jippruvaw
u jintużaw filtri blanzun,

1066
00:58:49,570 --> 00:58:51,840
iżda dawk teknikament mhumiex korretti.

1067
00:58:51,840 --> 00:58:55,804
Minħabba n-natura probabilistic tagħhom,
dawn jagħtu pożittivi foloz kultant.

1068
00:58:55,804 --> 00:58:57,095
Huma qed tfittex jibred fi, għalkemm.

1069
00:58:57,095 --> 00:58:59,030
Jirrakkomanda ħafna tfittex
lejn lilhom mill-inqas.

1070
00:58:59,030 --> 00:59:03,260
Imma għandek l-għażla tiegħek
bejn tabella hash u jipprova.

1071
00:59:03,260 --> 00:59:06,660
U li għaddej biex jkun fejn
inti tagħbija fil tiegħek dizzjunarju.

1072
00:59:06,660 --> 00:59:09,230
>> U ikollok bzonn li jagħżlu
funzjoni hash tiegħek,

1073
00:59:09,230 --> 00:59:13,420
ikollok bzonn li jagħżlu kif ħafna
Bramel għandek, u se jvarjaw.

1074
00:59:13,420 --> 00:59:17,440
Bħal jekk għandek aktar bramel,
forsi inneħħu run aktar mgħaġġla.

1075
00:59:17,440 --> 00:59:22,790
Imma forsi int wasting
lott ta 'spazju li mod, għalkemm.

1076
00:59:22,790 --> 00:59:26,320
Int għandek figura hija out.

1077
00:59:26,320 --> 00:59:27,140
Mmhmm?

1078
00:59:27,140 --> 00:59:29,875
>> UDJENZA: Inti qal qabel li
nistgħu nużaw funzjonijiet oħra hash,

1079
00:59:29,875 --> 00:59:31,750
li aħna ma jkollhom
toħloq funzjoni hash?

1080
00:59:31,750 --> 00:59:32,666
>> SPEAKER 1: Iva, id-dritt.

1081
00:59:32,666 --> 00:59:38,150
Allura litteralment għall-funzjoni hash tiegħek,
bħal google "funzjoni hash"

1082
00:59:38,150 --> 00:59:40,770
u tfittex xi dawk jibred.

1083
00:59:40,770 --> 00:59:43,250
Inti mhux mistennija li jibnu
funzjonijiet hash tiegħek stess.

1084
00:59:43,250 --> 00:59:46,100
Nies iqattgħu tagħhom
teżijiet fuq dawn l-affarijiet.

1085
00:59:46,100 --> 00:59:50,250
>> Allura ma joqogħdu jinkwetaw dwar il-bini tiegħek stess.

1086
00:59:50,250 --> 00:59:53,350
Isibu waħda online biex tibda bil.

1087
00:59:53,350 --> 00:59:56,120
Xi wħud minnhom inti għandek
jimmanipulaw ftit

1088
00:59:56,120 --> 00:59:59,430
biex jagħmlu tipi ritorn żgur jaqblu
u whatnot, hekk fil-bidu,

1089
00:59:59,430 --> 01:00:02,420
I jirrakkomanda jużaw xi ħaġa
verament faċli li forsi ftit

1090
01:00:02,420 --> 01:00:04,680
hashes fuq l-ewwel ittra.

1091
01:00:04,680 --> 01:00:08,760
U mbagħad darba inti għandek li xogħol,
jinkorporaw funzjoni hash cooler.

1092
01:00:08,760 --> 01:00:09,260
Mmhmm?

1093
01:00:09,260 --> 01:00:13,020
>> UDJENZA: Would jipprova jkun jew
effiċjenti iżda biss diffiċli biex, like--

1094
01:00:13,020 --> 01:00:15,880
>> SPEAKER 1: Allura jipprova, I think,
huwa intuwittivament diffiċli biex jiġu implimentati

1095
01:00:15,880 --> 01:00:18,310
iżda huwa mgħaġġel ħafna.

1096
01:00:18,310 --> 01:00:20,620
Madankollu, jieħu aktar spazju.

1097
01:00:20,620 --> 01:00:25,270
Għal darb'oħra, inti tista jottimizzaw kemm ta 'dawk fil-
modi differenti u hemm modi to--

1098
01:00:25,270 --> 01:00:26,770
UDJENZA: Kif aħna gradat fuq dan?

1099
01:00:26,770 --> 01:00:27,540
Ma matter--

1100
01:00:27,540 --> 01:00:29,164
>> SPEAKER 1: Allura inti qed gradati mod normali.

1101
01:00:29,164 --> 01:00:31,330
Inti qed tmur biex jiġi ggradat fuq disinn.

1102
01:00:31,330 --> 01:00:36,020
Liema mod inti tagħmel, inti tixtieq li
kun ċert li huwa kif eleganti kemm jista 'jkun

1103
01:00:36,020 --> 01:00:38,610
u effiċjenti kemm jista 'jkun.

1104
01:00:38,610 --> 01:00:41,950
Imma jekk inti tagħżel jipprova jew hash
tabella, sakemm taħdem,

1105
01:00:41,950 --> 01:00:45,350
aħna kuntenti ma 'dak.

1106
01:00:45,350 --> 01:00:48,370
U jekk inti tuża xi ħaġa li hashes
fuq l-ewwel ittra, li l-multa,

1107
01:00:48,370 --> 01:00:51,410
bħal forsi bħall-disinn għaqli.

1108
01:00:51,410 --> 01:00:53,410
Aħna wkoll qed jilħaq il-
punt f'dan semester--

1109
01:00:53,410 --> 01:00:55,340
I do not know jekk inti
guys noticed-- jekk int

1110
01:00:55,340 --> 01:00:58,780
gradi pset jonqsu ftit
minħabba d-disinn u whatnot,

1111
01:00:58,780 --> 01:00:59,900
li perfettament multa.

1112
01:00:59,900 --> 01:01:02,960
Huwa jkollna sa punt fejn tiegħek
programmi huma jkollna aktar ikkumplikata.

1113
01:01:02,960 --> 01:01:04,830
Hemm aktar postijiet
inti tista 'ttejjeb fuq.

1114
01:01:04,830 --> 01:01:06,370
>> Allura huwa perfettament normali.

1115
01:01:06,370 --> 01:01:08,810
Mhuwiex li int
tagħmel agħar fuq pset tiegħek.

1116
01:01:08,810 --> 01:01:11,885
Huwa biss aħna qed qed diffiċli fuqek issa.

1117
01:01:11,885 --> 01:01:13,732
Allura kulħadd tħossok.

1118
01:01:13,732 --> 01:01:14,940
I biss gradati psets kollha tiegħek.

1119
01:01:14,940 --> 01:01:16,490
Naf kulħadd qed tħossok.

1120
01:01:16,490 --> 01:01:19,600
>> Allura ma tkun inkwetat dwar dan.

1121
01:01:19,600 --> 01:01:23,580
U jekk għandek xi mistoqsijiet dwar
psets qabel jew modi inti tista 'ttejjeb,

1122
01:01:23,580 --> 01:01:27,760
I jippruvaw u jikkummentaw il speċifika
postijiet, imma xi kultant huwa tard

1123
01:01:27,760 --> 01:01:30,840
u niġi għajjien.

1124
01:01:30,840 --> 01:01:34,885
Hemm xi affarijiet oħra
dwar strutturi ta 'dejta?

1125
01:01:34,885 --> 01:01:37,510
Jien ċert li inti guys ma verament
trid titkellem dwarhom aktar,

1126
01:01:37,510 --> 01:01:42,650
imma jekk ikun hemm, jien kuntent li
jmorru fuqhom, kif ukoll xi ħaġa

1127
01:01:42,650 --> 01:01:45,580
minn lecture dan passat
ġimgħa jew ġimgħa li għaddiet.

1128
01:01:45,580 --> 01:01:51,580
>> Naf aħħar ġimgħa kienet kollha ta 'reviżjoni, hekk
aħna jista 'jkollhom skipped fuq xi reviżjoni

1129
01:01:51,580 --> 01:01:54,190
minn lecture.

1130
01:01:54,190 --> 01:01:58,230
Kwalunkwe mistoqsijiet oħra I jistgħu jwieġbu?

1131
01:01:58,230 --> 01:01:59,350
OK, id-dritt.

1132
01:01:59,350 --> 01:02:02,400
Ukoll, inti guys toħroġ 15 minuta kmieni.

1133
01:02:02,400 --> 01:02:08,370
>> Nispera li din kienet semi-utli għall-inqas,
u jien se tara inti guys ġimgħa d-dieħla,

1134
01:02:08,370 --> 01:02:12,150
jew ħinijiet tal-uffiċċju Ħamis.

1135
01:02:12,150 --> 01:02:15,285
Hemm talbiet għal snacks
għall-ġimgħa d-dieħla, huwa l-ħaġa?

1136
01:02:15,285 --> 01:02:17,459
Minħabba I nesa kandju illum.

1137
01:02:17,459 --> 01:02:19,750
U I miġjuba kandju aħħar
ġimgħa, iżda kienet Jum Columbus,

1138
01:02:19,750 --> 01:02:25,400
għaldaqstant kien hemm bħal sitt persuni li
kellu erba 'boroż ta' kandju lilhom infushom.

1139
01:02:25,400 --> 01:02:28,820
I tista 'ġġib starbursts
ġdid jekk inti tixtieq.

1140
01:02:28,820 --> 01:02:29,580
Starbursts?

1141
01:02:29,580 --> 01:02:32,250
OK, ħsejjes tajba.

1142
01:02:32,250 --> 01:02:35,050
Have jum kbir, guys.

1143
01:02:35,050 --> 01:02:39,510