True or false:
iter() is a method implemented for hash maps that returns all key-value pairs in the order they were added.
Fill in the blank, using a method you learned in this chapter, to shorten the vector below by five elements.
fn main() { let mut v = vec![5.12; 20]; v.; println!("{}", v.len()) }
What is the printed output of the following?
fn main() { let mut a = vec![49, 57, 12]; let mut b = Vec::from([43, 21, 56, 105]); // converting array into vec a.append(&mut b); a.reverse(); println!("{}", a.remove(0)) }
Fill in both blanks below so that the hash map has 32-bit unsigned integer keys and single character values.
use std::collections::HashMap; fn main() { let map: HashMap< , > = HashMap::new(); println!("{:?}", map) }
In light of your knowledge of how iter() behaves on hash maps, how does it behave for vectors?