tailieunhanh - Data Structures & Algorithms in Java PHẦN 8
Macros không có khái niệm về phạm vi, họ có giá trị từ quan điểm của định nghĩa đến cuối nguồn. Họ cắt một swath qua h tập tin, mã lồng nhau, . Khi # include'ing hàng chục ngàn cuối dòng? một nửa những khoảng trống hai lần các mục bắt đầu trên dòng mới mục tiếp theo trên hàng tạm thời khoảng trống cuối cùng chấm | Splitting a node in a 2-3-4 tree is the same as performing a color flip in a red-black tree. A rotation in a red-black tree corresponds to changing between the two possible orientations slants when transforming a 3-node. The height of a 2-3-4 tree is less than log2N. Search times are proportional to the height. The 2-3-4 tree wastes space because many nodes are not even half full. External storage means storing data outside of main memory usually on a disk. External storage is larger cheaper per byte and slower than main memory. Data in external storage is typically transferred to and from main memory a block at a time. Data can be arranged in external storage in sequential key order. This gives fast search times but slow insertion and deletion times. A B-tree is a multiway tree in which each node may have dozens or hundreds of keys and children. There is always one more child than there are keys in a B-tree node. For the best performance a B-tree is typically organized so that a node holds one block of data. If the search criteria involve many keys a sequential search of all the records in a file may be the most practical approach. Chapter 11 Hash Tables Overview A hash table is a data structure that offers very fast insertion and searching. When you first hear about them hash tables sound almost too good to be true. No matter how many data items there are insertion and searching and sometimes deletion can take close to constant time O 1 in Big O notation. In practice this is just a few machine instructions. For a human user of a hash table this is essentially instantaneous. It s so fast that computer programs typically use hash tables when they need to look up tens of thousands of items in less than a second as in spelling checkers . Hash tables are significantly faster than trees which as we learned in the preceding chapters operate in relatively fast O logN time. Not only are they fast hash tables are relatively easy to program. Hash tables do have several .
đang nạp các trang xem trước