The Self-Taught Computer Scientist


key: The piece of data you use to retrieve the value. Chapter 13


Download 1.48 Mb.
Pdf ko'rish
bet112/147
Sana17.06.2023
Hajmi1.48 Mb.
#1540634
1   ...   108   109   110   111   112   113   114   115   ...   147
Bog'liq
books-library.net-11301817Az7X6

key: The piece of data you use to retrieve the value.


Chapter 13 Hash Tables
145
value: The piece of data you use the key to retrieve.
hash table: A linear data structure that stores key- value pairs with unique keys.
hash function: Code that takes a key as input and outputs a unique piece of data that maps the key 
to an array index your computer uses to store the value.
hash value: The unique value a hash function produces.
collision: When two numbers hash to the same slot.
JavaScript Object Notation (JSON): A data- interchange format.
application programming interface (API): A program that allows applications to communicate 
with each other.
Challenge
1. 
Given a string, remove all duplicates words. For example, given the string 
"I am a self- 
taught programmer looking for a job as a programmer."
, your function 
should return 
"I am a self- taught programmer looking for a job as a."
.



14
Binary Trees
The most powerful people are the ones who never stop learning.
Rejoice Denhere
So far, all the data structures you’ve learned about have been linear. In the following chapters, you 
will learn about a few essential nonlinear data structures and abstract data types. The first one we will 
discuss is a tree, a nonlinear abstract data type made up of nodes connected in a hierarchical structure 
(Figure 14.1). Common tree operations include inserting, searching, and deleting.
There are several types of tree data structures: general trees, AVL trees, red- black trees, binary trees, 
binary search trees, and more. In this chapter, you will learn about general trees, binary search trees, 
and binary trees, with an emphasis on binary trees. Although covering every type of tree is outside of 
the scope of this book, I encourage you to learn more about other types of trees on your own.
A general tree is a data structure that starts with a node at the top. The node at the top of a tree is 
called the root node. Each node connected underneath a node in a tree is its child node. A node with 
5
8
9
4
13
7
9
6
14
8

Download 1.48 Mb.

Do'stlaringiz bilan baham:
1   ...   108   109   110   111   112   113   114   115   ...   147




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©fayllar.org 2024
ma'muriyatiga murojaat qiling