- Java 9 Data Structures and Algorithms
- Debasish Ray Chawdhuri
- 340字
- 2021-07-02 23:26:43
Chapter 2. Cogs and Pulleys – Building Blocks
We discussed algorithms in the previous chapter, but the title of the book also includes the term "data structure." So what is a data structure? A data structure is an organization of data in memory that is generally optimized so it can be used by a particular algorithm. We have seen that an algorithm is a list of steps that leads to a desired outcome. In the case of a program, there is always some input and output. Both input and output contain data and hence must be organized in some way or another. Therefore, the input and output of an algorithm are data structures. In fact, all the intermediate states that an algorithm has to go through must also be stored in some form of a data structure. Data structures don't have any use without algorithms to manipulate them, and algorithms cannot work without data structures. It's because this is how they get input and emit output or store their intermediate states. There are a lot of ways in which data can be organized. Simpler data structures are also different types of variables. For example, int
is a data structure that stores one 4-byte integer value. We can even have classes that store a set of specific types of values. However, we also need to think about how to store a collection of a large number of the same type of values. In this book, we will spend the rest of the time discussing a collection of values of the same type because how we store a collection determines which algorithm can work on them. Some of the most common ways of storing a collection of values have their own names; we will discuss them in this chapter. They are as follows:
- Arrays
- Linked lists
- Doubly linked lists
- Circular linked lists
These are the basic building blocks that we will use to build more complex data structures. Even if we don't use them directly, we will use their concepts.
- Mastering Ext JS(Second Edition)
- VMware View Security Essentials
- Java應(yīng)用開發(fā)與實踐
- PyTorch自然語言處理入門與實戰(zhàn)
- 編寫高質(zhì)量代碼:改善C程序代碼的125個建議
- C語言實驗指導(dǎo)及習(xí)題解析
- 深入分布式緩存:從原理到實踐
- 汽車人機(jī)交互界面整合設(shè)計
- Swift語言實戰(zhàn)晉級
- Practical Microservices
- Mastering JavaScript
- Modular Programming with JavaScript
- 一覽眾山小:ASP.NET Web開發(fā)修行實錄
- Developer,Advocate!
- 3D Printing Designs:Design an SD Card Holder