Sinopsis
In C++ we can declare and use arrays in two basic ways. The primitive method is to use the built-in array. The alternative is to use a vector. The syntax for both methods is more or less the same; however, the vector is much easier and slightly safer to use than the primitive array and is preferred for most applications. The major philosophical difference between the two is that the vector behaves as a first-class type (even though it is implemented in a library), whereas the primitive array is a second-class type. Similarly, C++ provides primitive strings (which are simply primitive arrays of char) and the muchpreferred string. In this section we examine what is meant by first-class and second-class types and show you how to use the vector and string
Content
- Arrays, Pointers, and Structures
- Objects and Classes
- Templates
- Inheritance
- Design Patterns
- Algorithm Analysis
- The Standard Template Library
- Recursion
- Sorting Algorithms
- Randomization
- Fun and Games
- Stacks and Compilers
- Utilities
- Simulation
- Graphs and Paths
- Stacks and Queues
- Linked Lists
- Trees
- Binary Search Trees
- Hash Tables
- A Priority Queue: The Binary Heap
- Splay Trees
- Merging Priority Queues
- The Disjoint Set Class
0 komentar:
Posting Komentar