COMP 1005 Lecture Notes - Lecture 13: Substring, Binary Search Algorithm, Binary Search Tree

15 views4 pages

Document Summary

A dictionary is a collection of unordered key/value pairs. Dictionaries in python are enclosed in curly brackets. There are two ways to create an empty dictionary: How to create a dictionary with only one or more values: We can access/modify values in a dictionary by specifying the key in square brackets [ ]. The length of a dictionary is the current number of keys in it. The in operator lets us check if a key is in a dictionary. Note: this way of iterating over a dictionary is not efficient. Since the dictionary is unordered, repeating this loop after modifying the dictionary may result in a completely new order. Note: this way of iterating over a dictionary is efficient. A binary search tree is a node-based binary tree data structure which has the following properties: The left subtree of a node only contains nodes with keys lesser than the node"s key.

Get access

Grade+20% off
$8 USD/m$10 USD/m
Billed $96 USD annually
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
40 Verified Answers
Class+
$8 USD/m
Billed $96 USD annually
Class+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
30 Verified Answers

Related Documents