Test for Chapter 1 keys
小学上册第5次英语第2单元测验试卷

小学上册英语第2单元测验试卷英语试题一、综合题(本题有100小题,每小题1分,共100分.每小题不选、错误,均不给分)1. A ________ (袋鼠) can jump very high and carries its baby in a pouch.2.She is ___ her shoes. (putting on)3.What shape is a basketball?A. SquareB. TriangleC. OvalD. SphereD4.The ________ was a famous explorer who mapped much of the globe.5.中国的________ (history) 充满了勇敢和智慧的故事。
6.My favorite holiday is ________.7.The _____ (青蛙) jumps from lily pad to lily pad. It is green and slimy. 青蛙从睡莲叶跳到睡莲叶。
它是绿色且滑腻的。
8.The country famous for its music is ________ (阿根廷).9.What do we call the part of the eye that controls the amount of light entering?A. RetinaB. LensC. IrisD. PupilC10.The __________ (气候) affects how we live.11.Which gas do humans breathe in?A. OxygenB. NitrogenC. Carbon DioxideD. HeliumA12. A base feels slippery and can turn __________ paper blue.13.What is the name of the famous bear from the jungle?A. BalooB. Winnie the PoohC. PaddingtonD. YogiA14.I like to plant ________ in spring.15.What is the main ingredient in pizza?A. BreadB. RiceC. PastaD. ChickenA16.Which day comes after Monday?A. SundayB. TuesdayC. WednesdayD. Thursday17.The chemical formula for iron(III) sulfate is _____.18.My cousin plays the ____ (bass guitar) in a band.19.He is playing in the ___. (sandbox)20.What do we call the force that pulls objects toward each other?A. MagnetismB. GravityC. FrictionD. Pressure21.What is the largest continent?A. AfricaB. AsiaC. North AmericaD. South America22.The ________ (河流源头) is often in the mountains.23.The capital of Tonga is _______.24.The first successful flight was achieved by the ________ (莱特兄弟).25.I like to watch my ________ grow.26.The __________ (历史的寓意) offers wisdom.27.I enjoy playing ________ (电子游戏) on my computer.28.My favorite animal is a ______ (兔子) that hops around happily.29.What do you call a type of music that tells a story?A. SymphonyB. OperaC. SonataD. ConcertoB30.The armadillo can curl into a ______ (球).31.What do we call the study of ancient cultures?A. ArchaeologyB. AnthropologyC. HistoryD. SociologyA32.My friend is great at __________ (解决问题).33.My sister enjoys learning about ____ (science).34.The ________ was a major conflict in the 20th century.35.Chemical reactions can release energy in various forms, including ______.36.The car is parked _____ (in front/behind) the house.37.Many plants have been used for ______ (传统) medicine.38.We are having ______ for dinner tonight. (spaghetti)39.The ________ (太阳) rises in the east.40.The ancient Romans used ________ for building strong structures.41.The _____ (天空) is blue.42.The ________ (玩具名称) can fly in the air.43. A __________ (植物的生命周期) includes several stages.munity gardens promote ______ (邻里关系).45.The dog is ___ (barking/silent).46.I have a toy _______ that can dig in the sand.47.I have a toy _______ that can light up the room.48.I love to watch the __________ during a thunderstorm. (闪电)49.Which animal is known for having a trunk?A. GiraffeB. ElephantC. RhinoD. Hippopotamus50.The butterfly is _______ (美丽的).51. A puppy is a young _________ (狗).52.I call my brother's friend __________. (他朋友的名字)53.What is the capital of Israel?A. JerusalemB. Tel AvivC. HaifaD. Nazareth54. A solid has a definite ______.55.I see a _____ (cat/dog) in the garden.56.Which instrument has black and white keys?A. GuitarB. ViolinC. PianoD. Drums57.The chemical formula for bismuth subsalicylate is _______.58.What is the name of the famous rock formation in Australia?A. Ayers RockB. UluruC. Great Barrier ReefD. KakaduB Uluru59.I have a ___ (story) to share.60.The ________ was a crucial chapter in the narrative of national unity.61.The ______ (香草) can enhance the flavor in dishes.62. A _______ is used to measure the amount of liquid in a container.63. A butterfly’s wings are covered in tiny ______.64.What do you call a baby rabbit?A. KitB. PupC. CalfD. ChickA65.What is the opposite of "happy"?A. SadB. ExcitedC. AngryD. TiredA66.Which insect makes honey?A. AntB. ButterflyC. BeeD. Fly答案:C67.What is the name of the famous river that flows through Egypt?A. NileB. AmazonC. MississippiD. YangtzeA68. A _______ illustrates the relationship between force and motion.69.We have ______ (许多) different cultures in our city.70.What is the main purpose of a school?A. To playB. To workC. To learnD. To sleepC71.I can see a _____ (汽车) in the street.72.The capital of Brazil is __________.73.What do we call a large amount of snow that falls quickly?A. ShowerB. BlizzardC. DrizzleD. Storm74.I saw a _____ (仙人掌) in the desert.75.We eat ______ (lunch) in the cafeteria.76.The _______ of sound can be influenced by the medium through which it travels.77.The invention of the printing press was by ________ (古腾堡).78.What is the name of the famous mountain in Nepal?A. K2B. KanchenjungaC. EverestD. MakaluC79.The first person to circumnavigate the globe was ______ (麦哲伦).80.What is the capital of Uganda?A. KampalaB. NairobiC. KigaliD. Dar es SalaamA81.The clock says it’s ___. (three)82.I found a ______ on the ground. (coin)83.I saw a _____ (仙人掌) in the desert during my trip.84.I saw a _______ (老虎) in the zoo.85. A walrus's thick blubber helps insulate it from cold ________________ (水).86.What is the capital of Mexico?A. CancunB. GuadalajaraC. Mexico CityD. MonterreyC87.The ability of a substance to dissolve is known as its _____.88.The __________ is famous for its unique rock formations.89.What is the shape of a coin?A. SquareB. CircleC. TriangleD. Rectangle90.The __________ of a toy car can be increased by pushing it harder.91.I can _______ my lunch to school.92.The ______ is known for her unique style.93. A raccoon is often seen at ______ (夜间) looking for food.94.What do we call the process of breathing out?A. InhaleB. ExhaleC. BreatheD. Respire95.Martin Luther King Jr. fought for __________ rights. (民权)96.My sister is passionate about __________ (环境保护).97.My uncle is a ________.98.Which fruit is yellow and curved?A. AppleB. BananaC. OrangeD. GrapeB99.The solid that forms from a chemical reaction is called a _______. (沉淀) 100.Chemical reactions can be affected by _____, concentration, and surface area.。
小学三年级上册第6次英语第3单元期测验题(答案和解释)

小学三年级上册英语第3单元期测验题(答案和解释)英语试题一、综合题(本题有50小题,每小题2分,共100分.每小题不选、错误,均不给分)1.Which animal is known for saying "Moo"?A. DogB. CowC. CatD. Horse2.Which one is an animal?A. TigerB. PlateC. KnifeD. Spoon3.What do you use to write?A. PenB. TableC. BedD. Shirt4.Which one is a shape?A. CircleB. CarC. DogD. Tree5.Which of these is a season?A. WinterB. DogC. ChairD. Plate6.This morning, I ______ (wake) up at 6:30. After I ______ (get) up, I ______ (brush) my teeth and ______ (eat) a quick breakfast. I ______ (leave) home at 7:00, and I ______ (catch) the bus just in time. It ______ (be) a busy but exciting morning.7.Which one is a color?A. AppleB. GreenC. FishD. Elephant8.What is the opposite of "up"?A. DownB. LeftC. RightD. Forward9.Which of these is a day of the week?A. JanuaryB. MondayC. WinterD. Blue10.My family enjoys hiking in the mountains. We usually go on weekends when the weather is nice. We bring __ and some snacks to eat during the hike. The trail is long, but the view from the top is beautiful. After hiking, we sit down to rest and drink some __.11.Which of these is a body part?A. TableB. LegC. ChairD. Book12.Which of these is the best way to stay healthy?A. Eat candy every dayB. Eat fruits and vegetablesC. Stay up all nightD. Drink soda all the time13.Which of these is a type of transport?A. CarB. ChairC. TableD. Bed14.What do you wear when it rains?A. HatB. JacketC. UmbrellaD. Gloves15.Which of the following is a fruit?A. CarrotB. AppleC. BreadD. Fish16.Which of these is used for writing on paper?A. PenB. ScissorsC. PlateD. Fork17.Which of these is a shape?A. CircleB. ChairC. DogD. Table18.Which of these is a month of the year?A. TuesdayB. JanuaryC. SundayD. December19.Which one is the correct spelling?A. RecieveB. ReceiveC. RecciveD. Recive20.What do you use to write on paper?A. PencilB. EraserC. ChalkD. Spoon21.Which of these is used to tell time?A. ClockB. SpoonC. PlateD. Knife22.Which of these shapes has three sides?A. SquareB. TriangleC. CircleD. Rectangle23.What do you do when you want to send an email?A. Write it on paperB. Use a computer or phoneC. Mail it with a stampD. Send a letter24.Which one is a color?A. AppleB. BlueC. DogD. Table25.Which one is the correct way to ask for someones name?A. How old are you?B. Whats your name?C. Where are you from?D. How are you?26.My dad ______ (work) in an office. He ______ (leave) for work at 8:00 every morning. After work, he sometimes ______ (go) to the gym to exercise. I ______ (like) to spend time with him, so on weekends we ______ (play) basketball together.27.What is the opposite of "clean"?A. TallB. HeavyC. DirtyD. Small28.Which of these is a shape?A. FishB. SquareC. DogD. Ball29.Which of these is a season?A. TuesdayB. SummerC. GreenD. March30.Which of these is used to eat food?A. KnifeB. SpoonC. ForkD. All of the above31.Which of these is a color?A. TableB. RedC. DogD. Shoe32.I ______ (like) to play video games after school. This afternoon, I ______ (play) a new game with my brother. He ______ (win) the game, but I ______ (have) fun anyway.33.Which of these is a type of animal?A. LionB. CarC. PhoneD. Shoe34.What is the opposite of "tall"?A. BigB. ShortC. LongD. Thin35.What is the opposite of "big"?A. TallB. SmallC. ShortD. Heavy36.Which animal is known for its roar?A. ElephantB. LionC. DogD. Bird37.Which of these is a fruit?A. CarrotB. StrawberryC. LettuceD. Potato38.What is the opposite of "hot"?A. ColdB. WarmC. WetD. Dry39.Which of these is used to cut food?A. SpoonB. KnifeC. PlateD. Cup40.What is the opposite of "fast"?A. SlowB. QuickC. TallD. Heavy41.I ______ (not/know) where my keys are. I ______ (look) for them everywhere, butI ______ (not/find) them yet.42.Which of these is a vegetable?A. BananaB. CucumberC. OrangeD. Pineapple43.Which one is used for writing?A. PenB. PlateC. SpoonD. Chair44.Which is a day of the week?A. JanuaryB. MondayC. SummerD. December45.What do we use to cook food?A. PlateB. SpoonC. OvenD. Glass46.Which of these is a geometric shape?A. CircleB. SpoonC. ForkD. Plate47.She is my _______.A. BrotherB. MotherC. SisterD. Cat48.What do you use to play music?A. DrumB. ChairC. SpoonD. Knife49.I am looking forward to the weekend. On Saturday, I’m going to visit my grandparents. They live in a house by the lake. We will go fishing, and I will help my grandmother bake cookies. I love spending time with them.50.I ______ (love) to read books. My favorite book ______ (be) about a young girl who ______ (go) on an adventure. Every night, I ______ (read) one chapter before bed. I ______ (imagine) myself as the main character and ______ (think) about the story all day. (答案及解释)。
送给朋友的英文祝福语

送给朋友的英文祝福语1. You're like a warm ray of sunshine on a cloudy day, my friend. May your days be filled with as much brightness as your smile brings to me. For example, when I was feeling down last week, just seeing you walk in the room was like the sun breaking through the clouds.2. Hey, friend! Life's a journey, and you're the coolest travel buddy one could ask for. I hope every step of your path is filled with amazing adventures and pleasant surprises. Remember that time we went on that road trip? It was full of unplanned stops and discoveries, just like life should be for you.3. My friend, you're a star that shines so bright. No matter how dark the night gets, your light will always cut through. Just as the North Star guides sailors, you guide those around you with your kindness. Like when we were lost in the city at night, your calmness led us to find our way home.4. You are the melody in the song of my life, friend. I hope your days are always filled with harmonious moments. Think about how a good song can lift your mood? Well, I hope your life is always like that amazing song.5. Friend, you're like a flower that never stops blooming. May your life be filled with colors, scents, and beauty. Just like that flower in your garden that keeps giving new blossoms every day.6. You know, my friend, you're the kind of person who makes every day feel like a party. I hope your real parties are even more epic! Remember when we had that impromptu party in your living room? That's the kind of fun I want you to always have.7. Hey, friend! You're a treasure chest full of wonderful things. I hope you keep opening up and sharing those treasures with the world. It's like when you showed me your old photo albums; each picture was a precious gem.8. My friend, you're a superhero without a cape. Your strength and kindness are your powers. I hope you use them to conquer every obstacle in your path. Just like how you helped me move last month, you were my hero that day.9. You are the rainbow after the rain in my world, friend. I wish for you a life full of those beautiful, unexpected post - storm wonders. Like the time we saw a double rainbow after a big storm, it was a magical moment that I hope your life is full of.10. Friend, you're like a book that I can never put down. I hope your story keeps getting more and more interesting. Every chapter in your life should be filled with excitement. Remember when you told me about your college years? It was like reading an amazing adventure story.11. You're the warm hug on a cold winter day, my friend. May you always be surrounded by that kind offort. Just like when we huddled together during that freezing camping trip.12. Hey, friend! You're a firework in the sky of life. I hope you keep exploding with joy and beauty. Think about how fireworks light up the whole night sky? That's how I want your life to be.13. My friend, you're the key that unlocks the best memories. I hope you keep making new keys for more amazing times. Like the time we found that old key and it led to an attic full of childhood toys.14. You are the chocolate in my life's box of candies, friend. I hope your days are sweet and full of delicious moments. Just like when we shared that box of chocolates and every piece was a little piece of heaven.15. Friend, you're like a lighthouse in the ocean of life. I hope you guide others and also find your own safe harbor. Remember when we were on that boat trip and saw the lighthouse in the distance? It was a reassuring sight.16. You're the laughter in my heart, my friend. I hope your life is filled with so much mirth that it overflows. Just like that time we couldn't stop laughing at that silly movie.17. Hey, friend! You're a diamond in the rough world. I hope you keep shining and showing your true value. It's like when we found that old ring at the thrift store and polished it up to see its beauty.18. My friend, you're the spring in the cycle of seasons of my life.I hope you always bring new beginnings and fresh starts. Just like how spring brings new life to the earth.19. You are the cozy blanket on a lazy Sunday, friend. I hope your days are filled with that kind of relaxation. Remember when we spent the whole Sunday just snuggled up reading books?20. Friend, you're the best ingredient in the recipe of my life. I hope your own life is cooked up with all the best things. Just like how a special ingredient can make a dish truly outstanding.。
人教版七年级英语上册unit1-6单元综合测试题有答案

人教版七年级英语上册unit1-6单元综合测试题有答案1.She is fine。
and I am fine。
too.2.I have XXX.3.My little XXX.4.Don't read under the sun。
it's bad for your eyes.5."What" do you like to eat。
- "Apples".6.Here are his set of keys。
but where are my keys?7.XXX?8."Where is my ball?" - "It's under the bed."9.They like to have these XXX.10."What is on the desk?" - "It's a hat."11.She has some chairs in her room.12.Can you bring this book to Mr。
Wu?13.She likes ice cream。
but she doesn't like water.14.What do you have for lunch。
A hamburger.15.Do you like volleyball。
I do。
It's interesting.16.XXX.17.What is in your bag。
Oh。
it's an interesting book.18.I can see some chairs。
The chairs are under the tree.19.I am hungry。
I want to have a snack.20.What sports do you like。
密码编码学与网络安全(第五版)答案

Chapter 1: Introduction (5)Chapter 2: Classical Encryption Techniques (7)Chapter 3: Block Ciphers and the Date Encryption Standard (13)Chapter 4: Finite Fields (21)Chapter 5: Advanced Encryption Standard (28)Chapter 6: More on Symmetric Ciphers (33)Chapter 7: Confidentiality Using Symmetric Encryption (38)Chapter 8: Introduction to Number Theory (42)Chapter 9: Public-Key Cryptography and RSA (46)Chapter 10: Key Management; Other Public-Key Cryptosystems (55)Chapter 11: Message Authentication and Hash Functions (59)Chapter 12: Hash and MAC Algorithms (62)Chapter 13: Digital Signatures and Authentication Protocols (66)Chapter 14: Authentication Applications (71)Chapter 15: Electronic Mail Security (73)Chapter 16: IP Security (76)Chapter 17: Web Security (80)Chapter 18: Intruders (83)Chapter 19: Malicious Software (87)Chapter 20: Firewalls (89)A NSWERS TO Q UESTIONS1.1The OSI Security Architecture is a framework that provides a systematic way of definingthe requirements for security and characterizing the approaches to satisfying thoserequirements. The document defines security attacks, mechanisms, and services, and the relationships among these categories.1.2 Passive attacks have to do with eavesdropping on, or monitoring, transmissions.Electronic mail, file transfers, and client/server exchanges are examples oftransmissions that can be monitored. Active attacks include the modification of transmitted data and attempts to gain unauthorized access to computer systems.1.3 Passive attacks: release of message contents and traffic analysis. Active attacks:masquerade, replay, modification of messages, and denial of service.1.4 Authentication: The assurance that the communicating entity is the one that it claims to be.Access control: The prevention of unauthorized use of a resource (i.e., this service controls who can have access to a resource, under what conditions access can occur, and what those accessing the resource are allowed to do).Data confidentiality: The protection of data from unauthorized disclosure.Data integrity: The assurance that data received are exactly as sent by an authorized entity(i.e., contain no modification, insertion, deletion, or replay).Nonrepudiation: Provides protection against denial by one of the entities involved in a communication of having participated in all or part of the communication.Availability service: The property of a system or a system resource being accessible and usable upon demand by an authorized system entity, according to performancespecifications for the system (i.e., a system is available if it provides services according to the system design whenever users request them).1.5 See Table 1.3.C HAPTER 2C LASSICAL E NCRYPTION T ECHNIQUESR2.1 Plaintext, encryption algorithm, secret key, ciphertext, decryption algorithm.2.2 Permutation and substitution.2.3 One key for symmetric ciphers, two keys for asymmetric ciphers.2.4 A stream cipher is one that encrypts a digital data stream one bit or one byte at atime. A block cipher is one in which a block of plaintext is treated as a whole and used to produce a ciphertext block of equal length.2.5 Cryptanalysis and brute force.2.6 Ciphertext only. One possible attack under these circumstances is the brute-forceapproach of trying all possible keys. If the key space is very large, this becomesimpractical. Thus, the opponent must rely on an analysis of the ciphertext itself, generally applying various statistical tests to it. Known plaintext. The analyst may be able to capture one or more plaintext messages as well as their encryptions.With this knowledge, the analyst may be able to deduce the key on the basis of the way in which the known plaintext is transformed. Chosen plaintext. If the analyst is able to choose the messages to encrypt, the analyst may deliberately pickpatterns that can be expected to reveal the structure of the key.2.7 An encryption scheme is unconditionally secure if the ciphertext generated by thescheme does not contain enough information to determine uniquely thecorresponding plaintext, no matter how much ciphertext is available. Anencryption scheme is said to be computationally secure if: (1) the cost of breaking the cipher exceeds the value of the encrypted information, and (2) the timerequired to break the cipher exceeds the useful lifetime of the information.2.8 The Caesar cipher involves replacing each letter of the alphabet with the letterstanding k places further down the alphabet, for k in the range 1 through 25.2.9 A monoalphabetic substitution cipher maps a plaintext alphabet to a ciphertextalphabet, so that each letter of the plaintext alphabet maps to a single unique letter of the ciphertext alphabet.2.10 The Playfair algorithm is based on the use of a 5 5 matrix of letters constructedusing a keyword. Plaintext is encrypted two letters at a time using this matrix.2.11 A polyalphabetic substitution cipher uses a separate monoalphabetic substitutioncipher for each successive letter of plaintext, depending on a key.2.12 1. There is the practical problem of making large quantities of random keys. Anyheavily used system might require millions of random characters on a regularbasis. Supplying truly random characters in this volume is a significant task.2. Even more daunting is the problem of key distribution and protection. For everymessage to be sent, a key of equal length is needed by both sender and receiver.Thus, a mammoth key distribution problem exists.2.13 A transposition cipher involves a permutation of the plaintext letters.2.14 Steganography involves concealing the existence of a message.2.1 a. No. A change in the value of b shifts the relationship between plaintext lettersand ciphertext letters to the left or right uniformly, so that if the mapping isone-to-one it remains one-to-one.b. 2, 4, 6, 8, 10, 12, 13, 14, 16, 18, 20, 22, 24. Any value of a larger than 25 isequivalent to a mod 26.c. The values of a and 26 must have no common positive integer factor other than1. This is equivalent to saying that a and 26 are relatively prime, or that thegreatest common divisor of a and 26 is 1. To see this, first note that E(a, p) = E(a,q) (0 ≤ p≤ q < 26) if and only if a(p–q) is divisible by 26. 1. Suppose that a and26 are relatively prime. Then, a(p–q) is not divisible by 26, because there is noway to reduce the fraction a/26 and (p–q) is less than 26. 2. Suppose that a and26 have a common factor k > 1. Then E(a, p) = E(a, q), if q = p + m/k≠ p.2.2 There are 12 allowable values of a (1, 3, 5, 7, 9, 11, 15, 17, 19, 21, 23, 25). There are 26allowable values of b, from 0 through 25). Thus the total number of distinct affine Caesar ciphers is 12 26 = 312.2.3 Assume that the most frequent plaintext letter is e and the second most frequentletter is t. Note that the numerical values are e = 4; B = 1; t = 19; U = 20. Then we have the following equations:1 = (4a + b) mod 2620 = (19a + b) mod 26Thus, 19 = 15a mod 26. By trial and error, we solve: a = 3.Then 1 = (12 + b) mod 26. By observation, b = 15.2.4 A good glass in the Bishop's hostel in the Devil's seat—twenty-one degrees andthirteen minutes—northeast and by north—main branch seventh limb east side—shoot from the left eye of the death's head— a bee line from the tree through the shot fifty feet out. (from The Gold Bug, by Edgar Allan Poe)2.5 a.The first letter t corresponds to A, the second letter h corresponds to B, e is C, sis D, and so on. Second and subsequent occurrences of a letter in the keysentence are ignored. The resultciphertext: SIDKHKDM AF HCRKIABIE SHIMC KD LFEAILAplaintext: basilisk to leviathan blake is contactb.It is a monalphabetic cipher and so easily breakable.c.The last sentence may not contain all the letters of the alphabet. If the firstsentence is used, the second and subsequent sentences may also be used untilall 26 letters are encountered.2.6The cipher refers to the words in the page of a book. The first entry, 534, refers topage 534. The second entry, C2, refers to column two. The remaining numbers are words in that column. The names DOUGLAS and BIRLSTONE are simply words that do not appear on that page. Elementary! (from The Valley of Fear, by Sir Arthur Conan Doyle)2.7 a.2 8 10 7 9 63 14 54 2 8 1056 37 1 9ISRNG BUTLF RRAFR LIDLP FTIYO NVSEE TBEHI HTETAEYHAT TUCME HRGTA IOENT TUSRU IEADR FOETO LHMETNTEDS IFWRO HUTEL EITDSb.The two matrices are used in reverse order. First, the ciphertext is laid out incolumns in the second matrix, taking into account the order dictated by thesecond memory word. Then, the contents of the second matrix are read left toright, top to bottom and laid out in columns in the first matrix, taking intoaccount the order dictated by the first memory word. The plaintext is then read left to right, top to bottom.c.Although this is a weak method, it may have use with time-sensitiveinformation and an adversary without immediate access to good cryptanalysis(e.g., tactical use). Plus it doesn't require anything more than paper and pencil,and can be easily remembered.2.8 SPUTNIK2.9 PT BOAT ONE OWE NINE LOST IN ACTION IN BLACKETT STRAIT TWOMILES SW MERESU COVE X CREW OF TWELVE X REQUEST ANYINFORMATION2.10 a.b.2.11 a. UZTBDLGZPNNWLGTGTUEROVLDBDUHFPERHWQSRZb.UZTBDLGZPNNWLGTGTUEROVLDBDUHFPERHWQSRZc. A cyclic rotation of rows and/or columns leads to equivalent substitutions. Inthis case, the matrix for part a of this problem is obtained from the matrix ofProblem 2.10a, by rotating the columns by one step and the rows by three steps.2.12 a. 25! ≈ 284b. Given any 5x5 configuration, any of the four row rotations is equivalent, for atotal of five equivalent configurations. For each of these five configurations,any of the four column rotations is equivalent. So each configuration in factrepresents 25 equivalent configurations. Thus, the total number of unique keysis 25!/25 = 24!2.13 A mixed Caesar cipher. The amount of shift is determined by the keyword, whichdetermines the placement of letters in the matrix.2.14 a. Difficulties are things that show what men are.b. Irrationally held truths may be more harmful than reasoned errors.2.15 a. We need an even number of letters, so append a "q" to the end of the message.Then convert the letters into the corresponding alphabetic positions:The calculations proceed two letters at a time. The first pair:The first two ciphertext characters are alphabetic positions 7 and 22, whichcorrespond to GV. The complete ciphertext:GVUIGVKODZYPUHEKJHUZWFZFWSJSDZMUDZMYCJQMFWWUQRKRb. We first perform a matrix inversion. Note that the determinate of theencryption matrix is (9 ⨯ 7) – (4 ⨯ 5) = 43. Using the matrix inversion formulafrom the book:Here we used the fact that (43)–1 = 23 in Z26. Once the inverse matrix has beendetermined, decryption can proceed. Source: [LEWA00].2.16 Consider the matrix K with elements k ij to consist of the set of column vectors K j,where:andThe ciphertext of the following chosen plaintext n-grams reveals the columns of K:(B, A, A, …, A, A) ↔ K1(A, B, A, …, A, A) ↔ K2:(A, A, A, …, A, B) ↔ K n2.17 a.7 ⨯ 134b.7 ⨯ 134c.134d.10 ⨯ 134e.24⨯ 132f.24⨯(132– 1) ⨯ 13g. 37648h.23530i.1572482.18 key: legleglegleplaintext: explanationciphertext: PBVWETLXOZR2.19 a.b.2.20your package ready Friday 21st room three Please destroy this immediately.2.21 y the message out in a matrix 8 letters across. Each integer in the key tellsyou which letter to choose in the corresponding row. Result:He sitteth between the cherubims. The isles may be gladthereof. As the rivers in the south.b.Quite secure. In each row there is one of eight possibilities. So if the ciphertextis 8n letters in length, then the number of possible plaintexts is 8n.c. Not very secure. Lord Peter figured it out. (from The Nine Tailors)3.1 Most symmetric block encryption algorithms in current use are based on the Feistelblock cipher structure. Therefore, a study of the Feistel structure reveals theprinciples behind these more recent ciphers.3.2 A stream cipher is one that encrypts a digital data stream one bit or one byte at atime. A block cipher is one in which a block of plaintext is treated as a whole and used to produce a ciphertext block of equal length.3.3 If a small block size, such as n = 4, is used, then the system is equivalent to aclassical substitution cipher. For small n, such systems are vulnerable to a statistical analysis of the plaintext. For a large block size, the size of the key, which is on the order of n 2n, makes the system impractical.3.4 In a product cipher, two or more basic ciphers are performed in sequence in such away that the final result or product is cryptographically stronger than any of the component ciphers.3.5 In diffusion, the statistical structure of the plaintext is dissipated into long-rangestatistics of the ciphertext. This is achieved by having each plaintext digit affect thevalue of many ciphertext digits, which is equivalent to saying that each ciphertext digit is affected by many plaintext digits. Confusion seeks to make the relationship between the statistics of the ciphertext and the value of the encryption key ascomplex as possible, again to thwart attempts to discover the key. Thus, even if the attacker can get some handle on the statistics of the ciphertext, the way in which the key was used to produce that ciphertext is so complex as to make it difficult todeduce the key. This is achieved by the use of a complex substitution algorithm. 3.6 Block size: Larger block sizes mean greater security (all other things being equal)but reduced encryption/decryption speed. Key size: Larger key size means greater security but may decrease encryption/decryption speed. Number of rounds: The essence of the Feistel cipher is that a single round offers inadequate security but that multiple rounds offer increasing security. Subkey generation algorithm:Greater complexity in this algorithm should lead to greater difficulty ofcryptanalysis. Round function: Again, greater complexity generally means greater resistance to cryptanalysis. Fast software encryption/decryption: In many cases, encryption is embedded in applications or utility functions in such a way as topreclude a hardware implementation. Accordingly, the speed of execution of the algorithm becomes a concern. Ease of analysis: Although we would like to make our algorithm as difficult as possible to cryptanalyze, there is great benefit inmaking the algorithm easy to analyze. That is, if the algorithm can be concisely and clearly explained, it is easier to analyze that algorithm for cryptanalyticvulnerabilities and therefore develop a higher level of assurance as to its strength.3.7 The S-box is a substitution function that introduces nonlinearity and adds to thecomplexity of the transformation.3.8 The avalanche effect is a property of any encryption algorithm such that a smallchange in either the plaintext or the key produces a significant change in theciphertext.3.9 Differential cryptanalysis is a technique in which chosen plaintexts with particularXOR difference patterns are encrypted. The difference patterns of the resultingciphertext provide information that can be used to determine the encryption key.Linear cryptanalysis is based on finding linear approximations to describe thetransformations performed in a block cipher.3.1 a. For an n-bit block size are 2n possible different plaintext blocks and 2n possibledifferent ciphertext blocks. For both the plaintext and ciphertext, if we treat theblock as an unsigned integer, the values are in the range 0 through 2n– 1. For amapping to be reversible, each plaintext block must map into a uniqueciphertext block. Thus, to enumerate all possible reversible mappings, the blockwith value 0 can map into anyone of 2n possible ciphertext blocks. For anygiven mapping of the block with value 0, the block with value 1 can map intoany one of 2n– 1 possible ciphertext blocks, and so on. Thus, the total numberof reversible mappings is (2n)!.b. In theory, the key length could be log2(2n)! bits. For example, assign eachmapping a number, from 1 through (2n)! and maintain a table that shows themapping for each such number. Then, the key would only require log2(2n)! bits, but we would also require this huge table. A more straightforward way todefine the key is to have the key consist of the ciphertext value for eachplaintext block, listed in sequence for plaintext blocks 0 through 2n– 1. This iswhat is suggested by Table 3.1. In this case the key size is n⨯ 2n and the hugetable is not required.3.2 Because of the key schedule, the round functions used in rounds 9 through 16 aremirror images of the round functions used in rounds 1 through 8. From this fact we see that encryption and decryption are identical. We are given a ciphertext c.Let m' = c. Ask the encryption oracle to encrypt m'. The ciphertext returned by the oracle will be the decryption of c.3.3 a.We need only determine the probability that for the remaining N – t plaintextsP i, we have E[K, P i] ≠ E[K', P i]. But E[K, P i] = E[K', P i] for all the remaining P iwith probability 1 – 1/(N–t)!.b.Without loss of generality we may assume the E[K, P i] = P i since E K(•) is takenover all permutations. It then follows that we seek the probability that apermutation on N–t objects has exactly t' fixed points, which would be theadditional t' points of agreement between E(K, •) and E(K', •). But apermutation on N–t objects with t' fixed points is equal to the number of wayst' out of N–t objects can be fixed, while the remaining N–t–t' are not fixed.Then using Problem 3.4 we have thatPr(t' additional fixed points) = ⨯Pr(no fixed points in N – t – t' objects)=We see that this reduces to the solution to part (a) when t' = N–t.3.4Let be the set of permutations on [0, 1, . . ., 2n– 1], which is referredto as the symmetric group on 2n objects, and let N = 2n. For 0 ≤ i≤ N, let A i be all mappings for which π(i) = i. It follows that |A i| = (N– 1)! and= (N–k)!. The inclusion-exclusion principle states thatPr(no fixed points in π)=== 1 – 1 + 1/2! – 1/3! + . . . + (–1)N⨯ 1/N!= e–1 +Then since e–1≈ 0.368, we find that for even small values of N, approximately37% of permutations contain no fixed points.3.53.6 Main key K = 111…111 (56 bits)Round keys K1 = K2=…= K16 = 1111..111 (48 bits)Ciphertext C = 1111…111 (64 bits)Input to the first round of decryption =LD0RD0 = RE16LE16 = IP(C) = 1111...111 (64 bits)LD0 = RD0 = 1111...111 (32 bits)Output of the first round of decryption = LD1RD1LD1 = RD0= 1111…111 (32 bits)Thus, the bits no. 1 and 16 of the output are equal to ‘1’.RD1 = LD0 F(RD0, K16)We are looking for bits no. 1 and 16 of RD1 (33 and 48 of the entire output).Based on the analysis of the permutation P, bit 1 of F(RD0, K16) comes from thefourth output of the S-box S4, and bit 16 of F(RD0, K16) comes from the second output of the S-box S3. These bits are XOR-ed with 1’s from the correspondingpositions of LD0.Inside of the function F,E(RD0) ≈ K16= 0000…000 (48 bits),and thus inputs to all eight S-boxes are equal to “000000”.Output from the S-box S4 = “0111”, and thus the fourth output is equal to ‘1’,Output from the S-box S3 = “1010”, and thus the second output is equal to ‘0’.From here, after the XOR, the bit no. 33 of the first round output is equal to ‘0’, and the bit no. 48 is equal to ‘1’.3.7 In the solution given below the following general properties of the XOR functionare used:A ⊕ 1 = A'(A ⊕ B)' = A' ⊕ B = A ⊕ B'A' ⊕ B' = A ⊕ BWhere A' = the bitwise complement of A.a. F (R n, K n+1) = 1We haveL n+1 = R n; R n+1 = L n⊕ F (R n, K n+1) = L n⊕ 1 = L n'ThusL n+2 = R n+1 = L n' ; R n+2 = L n+1 = R n'i.e., after each two rounds we obtain the bit complement of the original input,and every four rounds we obtain back the original input:L n+4 = L n+2' = L n ; R n+2 = R n+2' = R nTherefore,L16 = L0; R16 = R0An input to the inverse initial permutation is R16 L16.Therefore, the transformation computed by the modified DES can berepresented as follows:C = IP–1(SWAP(IP(M))), where SWAP is a permutation exchanging the positionof two halves of the input: SWAP(A, B) = (B, A).This function is linear (and thus also affine). Actually, this is a permutation, the product of three permutations IP, SWAP, and IP–1. This permutation ishowever different from the identity permutation.b. F (R n, K n+1) = R n'We haveL n+1 = R n; R n+1 = L n⊕ F(R n, K n+1) = L n⊕ R n'L n+2 = R n+1 = L n⊕ R n'R n+2 = L n+1⊕ F(R n+1, K n+2) = R n≈ (L n⊕ R n')' = R n⊕ L n⊕ R n'' = L nL n+3 = R n+2 = L nR n+3 = L n+2⊕ F (R n+2, K n+3) = (L n≈ R n') ⊕ L n' = R n' ⊕1 = R ni.e., after each three rounds we come back to the original input.L15 = L0; R15 = R0andL16 = R0(1)R16 = L0⊕ R0' (2)An input to the inverse initial permutation is R16 L16.A function described by (1) and (2) is affine, as bitwise complement is affine,and the other transformations are linear.The transformation computed by the modified DES can be represented asfollows:C = IP–1(FUN2(IP(M))), where FUN2(A, B) = (A ⊕ B', B).This function is affine as a product of three affine functions.In all cases decryption looks exactly the same as encryption.3.8 a. First, pass the 64-bit input through PC-1 (Table 3.4a) to produce a 56-bit result.Then perform a left circular shift separately on the two 28-bit halves. Finally,pass the 56-bit result through PC-2 (Table 3.4b) to produce the 48-bit K1.:in binary notation: 0000 1011 0000 0010 0110 01111001 1011 0100 1001 1010 0101in hexadecimal notation: 0 B 0 2 6 7 9 B 4 9 A 5b. L0, R0 are derived by passing the 64-plaintext through IP (Table 3.2a):L0 = 1100 1100 0000 0000 1100 1100 1111 1111R0 = 1111 0000 1010 1010 1111 0000 1010 1010c. The E table (Table 3.2c) expands R0 to 48 bits:E(R0) = 01110 100001 010101 010101 011110 100001 010101 010101d. A = 011100 010001 011100 110010 111000 010101 110011 110000e. (1110) = (14) = 0 (base 10) = 0000 (base 2)(1000) = (8) = 12 (base 10) = 1100 (base 2)(1110) = (14) = 2 (base 10) = 0010 (base 2)(1001) = (9) = 1 (base 10) = 0001 (base 2)(1100) = (12) = 6 (base 10) = 0110 (base 2)(1010) = (10) = 13 (base 10) = 1101 (base 2)(1001) = (9) = 5 (base 10) = 0101 (base 2)(1000) = (8) = 0 (base 10) = 0000 (base 2)f. B = 0000 1100 0010 0001 0110 1101 0101 0000g. Using Table 3.2d, P(B) = 1001 0010 0001 1100 0010 0000 1001 1100h. R1 = 0101 1110 0001 1100 1110 1100 0110 0011i. L1 = R0. The ciphertext is the concatenation of L1 and R1. Source: [MEYE82]3.9The reasoning for the Feistel cipher, as shown in Figure 3.6 applies in the case ofDES. We only have to show the effect of the IP and IP–1 functions. For encryption, the input to the final IP–1 is RE16|| LE16. The output of that stage is the ciphertext.On decryption, the first step is to take the ciphertext and pass it through IP. Because IP is the inverse of IP–1, the result of this operation is just RE16|| LE16, which isequivalent to LD0|| RD0. Then, we follow the same reasoning as with the Feistel cipher to reach a point where LE0 = RD16 and RE0 = LD16. Decryption is completed by passing LD0|| RD0 through IP–1. Again, because IP is the inverse of IP–1, passing the plaintext through IP as the first step of encryption yields LD0|| RD0, thusshowing that decryption is the inverse of encryption.3.10a.Let us work this from the inside out.T16(L15|| R15) = L16|| R16T17(L16|| R16) = R16|| L16IP [IP–1 (R16|| L16)] = R16|| L16TD1(R16|| L16) = R15|| L15b.T16(L15|| R15) = L16|| R16IP [IP–1 (L16|| R16)] = L16|| R16TD1(R16 || L16) = R16|| L16 f(R16, K16)≠ L15|| R153.11PC-1 is essentially the same as IP with every eighth bit eliminated. This wouldenable a similar type of implementation. Beyond that, there does not appear to be any particular cryptographic significance.3.13a.The equality in the hint can be shown by listing all 1-bit possibilities:We also need the equality A ⊕ B = A' ⊕ B', which is easily seen to be true. Now, consider the two XOR operations in Figure 3.8. If the plaintext and key for anencryption are complemented, then the inputs to the first XOR are alsocomplemented. The output, then, is the same as for the uncomplementedinputs. Further down, we see that only one of the two inputs to the secondXOR is complemented, therefore, the output is the complement of the outputthat would be generated by uncomplemented inputs.b.In a chosen plaintext attack, if for chosen plaintext X, the analyst can obtain Y1= E[K, X] and Y2 = E[K, X'], then an exhaustive key search requires only 255rather than 256 encryptions. To see this, note that (Y2)' = E[K', X]. Now, pick atest value of the key T and perform E[T, X]. If the result is Y1, then we knowthat T is the correct key. If the result is (Y2)', then we know that T' is the correctkey. If neither result appears, then we have eliminated two possible keys withone encryption.3.14 The result can be demonstrated by tracing through the way in which the bits areused. An easy, but not necessary, way to see this is to number the 64 bits of the key as follows (read each vertical column of 2 digits as a number):2113355-1025554-0214434-1123334-0012343-2021453-0202435-0110454- 1031975-1176107-2423401-7632789-7452553-0858846-6836043-9495226-The first bit of the key is identified as 21, the second as 10, the third as 13, and so on.The eight bits that are not used in the calculation are unnumbered. The numbers 01 through 28 and 30 through 57 are used. The reason for this assignment is to clarify the way in which the subkeys are chosen. With this assignment, the subkey for the first iteration contains 48 bits, 01 through 24 and 30 through 53, in their naturalnumerical order. It is easy at this point to see that the first 24 bits of each subkey will always be from the bits designated 01 through 28, and the second 24 bits of each subkey will always be from the bits designated 30 through 57.3.15 For 1 ≤ i ≤ 128, take c i∈ {0, 1}128 to be the string containing a 1 in position i andthen zeros elsewhere. Obtain the decryption of these 128 ciphertexts. Let m1,m2, . . . , m128 be the corresponding plaintexts. Now, given any ciphertext c which does not consist of all zeros, there is a unique nonempty subset of the c i’s which we can XOR together to obtain c. Let I(c) ⊆ {1, 2, . . . , 128} denote this subset.ObserveThus, we obtain the plaintext of c by computing . Let 0 be the all-zerostring. Note that 0 = 0⊕0. From this we obtain E(0) = E(0⊕0) = E(0) ⊕ E(0) = 0.Thus, the plaintext of c = 0 is m = 0. Hence we can decrypt every c ∈ {0, 1}128.3.16a. This adds nothing to the security of the algorithm. There is a one-to-onereversible relationship between the 10-bit key and the output of the P10function. If we consider the output of the P10 function as a new key, then thereare still 210 different unique keys.b. By the same reasoning as (a), this adds nothing to the security of the algorithm.3.17s = wxyz + wxy + wyz + wy + wz + yz + w + x + zt = wxz + wyz + wz + xz + yz + w + y3.18OK4.1 A group is a set of elements that is closed under a binary operation and that isassociative and that includes an identity element and an inverse element.4.2 A ring is a set of elements that is closed under two binary operations, addition andsubtraction, with the following: the addition operation is a group that iscommutative; the multiplication operation is associative and is distributive over the addition operation.C HAPTER 4F INITE F IELDS。
myth

Keys to Chapter 1 (Greek myths)Exercise I. Filling the blanks with the information from this chapter:1.In the beginning there was only chaos2.Rhea convinced Cronus to accept his son and Zeus was allowed to return to MountOlympus(奥林匹斯山;天堂,等同于heaven) as Cronus's cupbearer.3.Prometheus shaped man out of mud, and Athena breathed life into his clay figure.4.Prometheus loved man more than the Olympians, who had banished most of his family toTartarus.5.The golden age was an age of perfection, of innocence and happiness, in which truth andjustice prevailed, not through, force, or power, but through man‟s natural goodness.6.It was in the silver age that Zeus introduced the seasons of the year, which meant thedispleasure and discomfort of summer heat and winter cold.7. In the iron age crime was common, and all the qualities that we hold up as ideals, truth,modesty, virtue, honor, decency – were stifled (窒息,压制)Exercise II. Decide whether the following statements are true or false. If false, correct it:(T ) 1. Gaea was both the mother and wife of Uranus.(F) 2. Atlas was punished to shoulder the earth in that he helped man to trick Zeus in choosingseemingly nice sacrifice of bones wrapped in juicy fat.Correction: Atlas was punished to shoulder the earth in that he was the leader of the Titans who had fought against Zeus but failed(F) 3. Zeus had Hephaestus create Pandora, a mortal of stunning beauty to marry Epimetheus. Correction: Zeus had Hephaestus create Pandora, a mortal of stunning beauty to punish man. (F) 4. The brazen age was an age of suffering hardship and decay.Correction: The silver age was an age of suffering hardship and decay.(T) 5. The iron age is suspiciously modern in its resemblance to later and present-day society.Exercise III. Answer the following questions briefly:1.Why Gaea helped her son Cronus to dethrone his father Uranus and the so did Rhea supportedZeus to Cronus?(Answer) Uranus was a bad father and husband. He hated the Hecatoncheires. He imprisoned them by pushing them into the hidden places of the earth, Gaea's womb. This angered Gaea and she plotted against Uranus. With the help of Mother Gaea, Cronus attacked and dethroned Uranus, and became the next ruler.However, Gaea and Uranus both had prophesied that he would be overthrown by a son. To avoid this Cronus swallowed each of his children as they were born. Rhea was angry at the treatment of the children and plotted against Cronus.2. How did Prometheus create man? Why did Zeus inflict a terrible punishment on him and how?Who finally freed Prometheus?(Answer) Prometheus was given the task of creating man. He shaped man out of mud, and Athena breathed life into his clay figure.Zeus was angry at Prometheus for three things: being tricked on sacrifices, stealing fire for man, and for refusing to tell Zeus which of Zeus's children would dethrone him. Zeus had Forceand Violence seized Prometheus to the Caucasus Mountains(高加索山脉), and chained him to a rock with unbreakable chains. Here he was tormented (折磨) day and night by a giant eagle tearing at his liver.Eventually, by meeting Zeus' two conditions an immortal Chiron(客戎,半人半马的怪物)the Centaur agreed to die for him and a mortal Heracles(大英雄赫拉克勒斯)killed the eagle and unbound him.3. Why Deucalion and his wife Pyrrha are treated as Greeks‟ great ancestor?(Answer) When iron age came, the world was red with blood, and civil and foreign wars were as common as crime. So Zeus decided to drown the world and its inhabitants –only the fear of setting heaven itself ablaze kept him from starting a fire – and to create a new world and race. Only one mountain stood out of the water. That was Parnassus (帕纳塞斯山).Only one boat floated on the sea, and in it were a man and his wife, Deucalion(丢卡里翁)and Pyrrha(皮拉). They had been good when everybody else was bad, and Zeus had taken care of them through the storm and the flood.After the flood they asked the oracle, a solemn voice answered them to cast their mother's bones behind them as they go down. went down the mountain. So as they went they stooped and picked up stones and threw them back over their shoulders. Presently a lot of young men and women followed them as a big family. So the world was peopled again, and all the Greeks look back to Deucalion and his wife as their great ancestors.Exercise IV. Figure out the meaning of the allusions bellow after reading the stories: Prometheus‟s gift: It refers t o the spark of fire, the light of civilization, or the strong will and spirit to fight the evil power in order to achieve a noble goal.Pandora‟s box: It refers to the source of all disasters or gifts that cause misfortunes.Deucalion‟s flood: It refers t o the renewal of human beings.Deucalion: the ancestor of human beings.Keys to Chapter 2 (Greek myths)Exercise I. Filling the blanks with the information from this chapter:1.Zeus‟ weapon is a thunderbolt (霹雳) which he hurls at those who displease him. AndPoseidon‟s weapon is a trident, which can shake the earth, and shatter any object.2.Hera took Argus‟ hundred eyes and set them into the tail of her favorite bird, the peacock.3. A descendent of Io was a great hero and set Prometheus free. And Leto bore the divine twins,Artemis and Apollo.4.Each city had a public hearth sacred to Hestia, where the fire was never allowed to go out. Ofall the Olympians, she is the mildest, most upright and most charitable (慈悲的).5.Athena is fierce and brave in battle but, only wars to defend the state and home from outsideenemies.6.The legend of the birth of Athena goes that Zeus came to lust after Metis, the goddess ofwisdom.7.The story of Adonis provides a basis for the origin of myrrh and the origin of the rose, whichgrew from each drop of blood that fell.8.One of Apollo's more important daily tasks is to harness his chariot with four horses, anddrive the Sun across the sky. And Hermes is the cleverest of the Olympian gods, andmessenger to all the other gods.9.Artemis became associated with the moon. She is a virgin goddess, and the goddess ofchastity.10.Demeter is intimately associated with the seasons. Her daughter Persephone was abducted byHades to be his wife in the underworld.11.Dionysus became associated with several key concepts. One was rebirth after death12.Eros‟ arrows came in two types: golden with dove feathers which aroused love, or leadenarrows which had owl feathers that caused indifference. Angered Psyche had seen him Eros fled and the distraught (心烦意乱的) she roamed the earth trying in vain to find her lover.13.Trojan War was an indirect result of not inviting Eris to a wedding.14.Pan is an excellent musician and plays the pipes. He is merry and playful frequently seendancing with woodland nymphs.Exercise II. Decide whether the following statements are true or false. If false, correct it:(F) 1. By drawing lots with his brother Poseidon and Atlas, Zeus became the supreme ruler of thegods.Correction: By drawing lots with his brother Poseidon and Hades, Zeus became the supreme ruler of the gods.(F) 2.Transformed into a beautiful white bull, Zeus seduced Io and then brought her to Crete. Correction: Transformed into a beautiful white bull, Zeus seduced Eropa and then brought her to Crete.(F) 3. Poseidon created the first horse, the most beautiful animal, in the world to court Leto. Correction: Poseidon created the first horse, the most beautiful animal, in the world to court Demeter(T) 4. The god of war as he was, Ares was also a coward when he was caught in an act of adultery with Aphrodite.(T) 5. Athena sprang full grown in armor from Zeus forehead, and she is the embodiment of wisdom, reason and purity.(F) 6. Except Aphrodite, Demeter was also taken by the beauty of Adonis and fought to keep him. Correction: Except Aphrodite, Persephone was also taken by the beauty of Adonis and fought to keep him.(T)7. Eros, the god of love, is often represented blindfolded because love is often blind.(F) 8. The word “panic” is associated with the god of shepherds, Pan, the son of Hermes and Eris,the goddess of discord.Correction: The word “panic” is associated with the god of shepherds, Pan, the son of Hermes and Penelope.Exercise III. Answer the following questions briefly: three notable affairs of Zeus, and what do you think is implication of the fact that inGreek myth the supreme god Zeus was always disloyal to his legal wife Hera?(Answer) Europa beloved by Zeus. He took the form of a beautiful white bull and encountered her at the seashore. By appearing to be very tame, he coaxed (诱使) her to climb onto his back and took her to Crete, where Europa had three sons for Zeus.Zeus also fell in love with Io, a beautiful princess, and seduced her. In an attempt to avoid the rage and jealousy of Hera, he transformed Io into a handsome white heifer. But the trick wasseen through by Hera, who asked for the heifer as a present. Then Hera deposited Io in the safe keeping of Argus, the watchman with a hundred eyes. Later on Zeus sent Hermes to rescue Io. Finally Io was restored by Zeus and bore him a son, a descendent of whom was the great hero Heracles and set Prometheus free.Leto was one of the many consorts (配偶) of Zeus. From their union Leto bore the divine twins, Artemis and Apollo. Leto found this to be an arduous (艰巨的) task, as Hera had refused Leto to give birth on any mainland or on any island.2.Why the wreath of laurel leaves always symbolize victory, distinct and success? (Answer) This originates from the tragic love story of Apollo and Daphne. Daphne was Apollo's first love. It was brought about by the malice (恶意) of Eros. Once Eros became angry with Apollo for mocking the power of his arrows. To punish him, Eros drew two arrows of different workmanship, one to excite love, the other to repel it. The former was of gold and sharp-pointed, the latter blunt and tipped with lead. With the leaden one he struck the nymph Daphne and with the golden one Apollo, through the heart. Then Apollo fell desperately in love with Daphne, and began to pursue Daphne in the woods. When Apollo was about to grasp Daphne she prayed to her father, the rive god, and was transformed into a laurel tree. Sadly, Apollo declared that the leaves of the laurel tree would always be green, which symbolizes victory, success and distinction in Greek culture. And he would always wear a wreath of laurel leaves3.Don‟t you think it‟s a sort of tragedy for the most beautiful goddess Aphrodite to marry theugliest god Hephaestus? Does that remind you of the tragic marriage of Pan Jinlian to Wu Dalang, the elder brother of hero Wu Song in Chinese literature?(Answer) Aphrodite is the goddess of love, sexual desire and beauty. After her birth, Zeus was afraid that the gods would fight over Aphrodite's hand in marriage so he married her off to the smith god Hephaestus, who is the only god to be physically ugly and he is also lame. Of course Aphrodite was not at all pleased at being the wife of sooty (乌黑的), hard-working Hephaestus. Then she had many affairs, among which was she and her brother-in-law Ares, the god of war, and Eros, the god of love, was the result of such a immoral love.This may remind us of the tragic marriage of Pan Jinlian and Wu Dalang in Chinese literature. The young beauty Pan Jinliang was also forced to marry Wu Dalang, the elder brother of hero Wu Song by her master. Similarly she was also dissatisfied with her short and ugly husband and fell in love with her brother-in-law hero Wu Song. The difference is that Wu Song refused such a immoral love and finally took revenge by killing her after she was found to have committed with Ximeng Qing and murdered her husband.So both immoral love was the tragedy under authority.4.What is the dual nature of, the god of wine? Why he became associated with several keyconcepts in daily life?(Answer) Dionysus was the god of fertility and wine. He invented wine and spread the art of tending grapes. He has a dual nature. On the one hand, bringing joy and divine (神妙的,极好的) ecstasy (狂喜,消魂). On the other hand, brutal (残暴的,野蛮的) and unthinking rage (暴行). Thus, reflecting both sides of wines nature.Dionysus became associated with several key concepts. One was rebirth after death. Herehis dismemberment (肢解) by the Titans and return to life is symbolically echoed in tending vines, where the vines must be pruned (修剪) back sharply, and then become dormant (休眠) in winter for them to bear fruit. The other is the idea that under the influence of wine, one could feel possessed by a greater power. Unlike other gods Dionysus was not only outside his believers but als within them. At these times a man might be greater than himself and do works he otherwise could not.Exercise IV. Figure out the meaning of the allusions bellow after reading the stories:Apollo: a handsome young manAdonis: a handsome young manA request from Semele: an improper desire, a request leading to one‟s destructionFar from Jupiter, far from danger: it is too dangerous to be too close to a tyrantBe a Diana: a woman remains unmarriedAs swift as Hermes: a quick thiefAs cunning as Hermes: extremely cunning and deceitfulBacchus: a person who is addicted to drinkSon of Bacchus: a person who is addicted to drinkLaurels: 桂冠an emblem of victory or honourPoet Laureate: the poets who have gained great success and extremely high reputation; poet officially appointed to the Royal Household in Britain, to write poems for state occasions (桂冠诗人,正式任命为王室成员,为国家大典作诗者)As shy as Daphne: too shy to see a strangerFreedom of Pan/ as free as Pan: an absolute freedom希腊第三章练习Exercise I. Filling the blanks with the information from this chapter:1. Alcmene, sixteenth in descent from Niobe, was the last mortal woman with whom Zeus lay, for he saw no prospect of begetting a hero to equal Heracles by any other.2. Since the Nemean Lion was proof against all weapons, Heracles wrestled with it and finally strangled the creature to death. He carried the carcass back to Mycenae and used its pelt as armor and the head as helmet.3. In his fifth task Heracles diverted two rivers nearby so that they flew into the Augean stables, swept them clean.4. At the moment of sacrifice Nephele caught up her children and set them on a ram with a golden fleece, which carried them eastward through the heavens.5. With the help of gods, the Argonauts started their adventurous voyage on the Argo, the strongest and the fastest ship.6. When the Argonauts stopped on an island, Heracles went to search for Hylas, but in vain. He was so long away from camp that the Argonauts continued the journey without him.7. When growing up, Theseus lifted the rock and retrieved the sword and sandals, and set off for Athens to look for his father.8. Theseus' most important feat was the killing of the Minotaur.Exercise II. Read the following descriptions for some famous characters in this chapter and give their names according to the description.1. The nine-headed monster that was slain by Heracles. (Hydra)2. The members of a nation of women warriors. One of Heracles‟ labors was to obtain the girdle of their queen. (Amazons)3. The goddess of youth and spring, cupbearer to the Olympian gods. She was married to Heracles after he became a god. (Hebe)4. The husband of Medea and leader of the Argonauts who went in quest of the Golden Fleece. (Jason)5. A king of Crete, the son of Zeus and Europa, who was made one of the three judges in the underworld after his death. (Minos)6. A hero and king of Athens who slew the Minotaur. (Theseus)7. The daughter of Minos, who gave Theseus the thread with which he found his way out of the Minotaur's labyrinth. (Ariadne)8. The wise king of the centaurs, who was fatally wounded by Heracles, and agreed to die for Prometheus. (Chiron)Exercise III. Think of the meaning of the allusions bellow after reading the stories:Augean stables: refers to an extremely dirty placeHydra: something difficult to root out; or a recurring problemAmazons: tall strong athletic woman or female warriorsAtlas: a strong man with heavy burdens; the book of mapsAccomplishments of Heracles: tremendous deedsBe a Jason: an unfaithful husband; be a fickle-hearted manGolden fleece : treasures obtained after innumerous untold hardshipsArgonauts : courageous navigator or adventurer.Sow dragon‟s teeth: provoke war by spreading dispute; or cultivate warriors or monstersCirce: witch, sorceress, enchantress who charmed menSirens‟ song: fine-sounding words; words that confuse or mislead people•Medea‟s kettle: a way to restore youthWith the ambition of Theseus: to cherish great aspirations and lofty idealsThe bed of Procrustes: brutal and unreasonable policyAriadne‟s thread: a solution to a confusing problemAegean Sea: a father‟s deep love for his sonLabyrinth: complicated thing; situation difficult to get away fromExercise IV. Mark out the allusions in the sentences below, and interpret the meaning of the sentences:参看上题4-5Exercise I. Figure out the meaning of the allusions bellow after reading the stories:1. An Apple of Discord争斗之源;不和之因;祸根An Apple of Discord直译为"纠纷的苹果",出自荷马史诗Iliad中的希腊神话故事传说希腊阿耳戈英雄(Argonaut)珀琉斯(Peleus)和爱琴海海神涅柔斯的女儿西蒂斯(Thetis)在珀利翁山举行婚礼,大摆宴席。
Test for Chapter 1

b. $500.
c. $50,000.
d. This cannot be determined from the information given.
Answer: B
8. Suppose the cost of flying a 100-seat plane for an airline is $50,000 and there are 10 empty seats on a flight. The marginal cost of flying a passenger is a. $50. b. $500. c. $50,000. d. This cannot be determined from the information given. Answer: D
Answer: D
2. John is an athlete. He has $120 to spend and wants to buy either a heart rate monitor or new running shoes. Both the heart rate monitor and running shoes cost $120, so he can only buy one. This illustrates the principle that
3. Refer to Scenario 1-1. What is your opportunity cost of going to the movies? $12.50 and 10 points on your exam grade
10. It costs a company $35,000 to produce 500 calculators. The company’s cost will be $35,050 if it produces an additional calculator. If the company produces 500 calculators then a. its average cost is greater than its marginal cost. b. its average cost and its marginal cost are equal. c. its average cost is less than its marginal cost. d. This cannot be determined from the information given. Answer: A
JAVA数据结构习题及解答(英)

QuestionsThese questions are intended as a self-test for readers.Answers to the questions may be found in Appendix C.1.In many data structures you can________a single record,_________it,and_______it.2.Rearranging the contents of a data structure into a certain order is called_________.30CHAPTER1Overview3.In a database,a field isa.a specific data item.b.a specific object.c.part of a record.d.part of an algorithm.4.The field used when searching for a particular record is the______________.5.In object-oriented programming,an objecta.is a class.b.may contain data and methods.c.is a program.d.may contain classes.6.A classa.is a blueprint for many objects.b.represents a specific real-world object.c.will hold specific values in its fields.d.specifies the type of a method.7.In Java,a class specificationa.creates objects.b.requires the keyword new.c.creates references.d.none of the above.8.When an object wants to do something,it uses a________.9.In Java,accessing an object’s methods requires the_____operator.10.In Java,boolean and byte are_____________.(There are no experiments or programming projects for Chapter1.)Questions31Chapter1,OverviewAnswers to Questions1.insert,search for,delete2.sorting3.c4.search key5.b6.a7.d8.method9.dot10.data typesQuestionsThese questions are intended as a self-test for readers.Answers may be found in Appendix C.1.Inserting an item into an unordered arraya.takes time proportional to the size of the array.b.requires multiple comparisons.c.requires shifting other items to make room.d.takes the same time no matter how many items there are.2.True or False:When you delete an item from an unordered array,in most cases you shift other items to fill in the gap.3.In an unordered array,allowing duplicatesa.increases times for all operations.b.increases search times in some situations.c.always increases insertion times.d.sometimes decreases insertion times.4.True or False:In an unordered array,it’s generally faster to find out an item is not in the array than to find out it is.5.Creating an array in Java requires using the keyword________.6.If class A is going to use class B for something,thena.class A’s methods should be easy to understand.b.it’s preferable if class B communicates with the program’s user.c.the more complex operations should be placed in class A.d.the more work that class B can do,the better.7.When class A is using class B for something,the methods and fields class A can access in class B are called class B’s__________.74CHAPTER2Arrays8.Ordered arrays,compared with unordered arrays,area.much quicker at deletion.b.quicker at insertion.c.quicker to create.d.quicker at searching.9.A logarithm is the inverse of_____________.10.The base10logarithm of1,000is_____.11.The maximum number of elements that must be examined to complete a binary search in an array of200elements isa.200.b.8.c.1.d.13.12.The base2logarithm of64is______.13.True or False:The base2logarithm of100is2.14.Big O notation tellsa.how the speed of an algorithm relates to the number of items.b.the running time of an algorithm for a given size data structure.c.the running time of an algorithm for a given number of items.d.how the size of a data structure relates to the number of items.15.O(1)means a process operates in_________time.16.Either variables of primitive types or_________can be placed in an array. Chapter2,ArraysAnswers to Questions1.d2.True3.b4.False5.new6.d740APPENDIX C Answers to Questions7.interface8.d9.raising to a power10.311.812.613.False14.a15.constant16.objectsuestionsThese questions are intended as a self-test for readers.Answers may be found in Appendix C.puter sorting algorithms are more limited than humans in thata.humans are better at inventing new algorithms.puters can handle only a fixed amount of data.c.humans know what to sort,whereas computers need to be told.puters can compare only two things at a time.2.The two basic operations in simple sorting are_________items and_________ them(or sometimes_________them).3.True or False:The bubble sort always ends up comparing every item with every other item.4.The bubble sort algorithm alternates betweenparing and swapping.b.moving and copying.c.moving and comparing.d.copying and comparing.5.True or False:If there are N items,the bubble sort makes exactly N*N comparisons.Questions1096.In the selection sort,a.the largest keys accumulate on the left(low indices).b.a minimum key is repeatedly discovered.c.a number of items must be shifted to insert each item in its correctlysorted position.d.the sorted items accumulate on the right.7.True or False:If,in a particular sorting situation,swaps take much longer than comparisons,the selection sort is about twice as fast as the bubble sort.8.A copy is________times as fast as a swap.9.What is the invariant in the selection sort?10.In the insertion sort,the“marked player”described in the text corresponds to which variable in the insertSort.java program?a.inb.outc.tempd.a[out]11.In the insertion sort,“partially sorted”means thata.some items are already sorted,but they may need to be moved.b.most items are in their final sorted positions,but a few still need to be sorted.c.only some of the items are sorted.d.group items are sorted among themselves,but items outside the groupmay need to be inserted in it.12.Shifting a group of items left or right requires repeated__________.13.In the insertion sort,after an item is inserted in the partially sorted group,it willa.never be moved again.b.never be shifted to the left.c.often be moved out of this group.d.find that its group is steadily shrinking.110CHAPTER3Simple Sorting14.The invariant in the insertion sort is that________.15.Stability might refer toa.items with secondary keys being excluded from a sort.b.keeping cities sorted by increasing population within each state,in a sortby state.c.keeping the same first names matched with the same last names.d.items keeping the same order of primary keys without regard to secondary keys.Chapter3,Simple SortingAnswers to Questions1.dparing and swapping(or copying)3.False4.a5.False6.b7.False8.three9.Items with indices less than or equal to outer are sorted.10.c11.d12.copies13.b14.Items with indices less than outer are partially sorted.15.buestionsThese questions are intended as a self-test for readers.Answers may be found in Appendix C.1.Suppose you push10,20,30,and40onto the stack.Then you pop three items. Which one is left on the stack?2.Which of the following is true?a.The pop operation on a stack is considerably simpler than the remove operation on a queue.b.The contents of a queue can wrap around,while those of a stack cannot.c.The top of a stack corresponds to the front of a queue.d.In both the stack and the queue,items removed in sequence are takenfrom increasingly high index cells in the array.3.What do LIFO and FIFO mean?4.True or False:A stack or a queue often serves as the underlying mechanism on which an ADT array is based.5.Assume an array is numbered with index0on the left.A queue representing a line of movie-goers,with the first to arrive numbered1,has the ticket window on the right.Thena.there is no numerical correspondence between the index numbers andthe movie-goer numbers.b.the array index numbers and the movie-goer numbers increase inopposite left-right directions.c.the array index numbers correspond numerically to the locations in theline of movie-goers.d.the movie-goers and the items in the array move in the same direction.6.As other items are inserted and removed,does a particular item in a queue move along the array from lower to higher indices,or higher to lower?7.Suppose you insert15,25,35,and45into a queue.Then you remove three items.Which one is left?8.True or False:Pushing and popping items on a stack and inserting and removing items in a queue all take O(N)time.174CHAPTER4Stacks and Queues9.A queue might be used to holda.the items to be sorted in an insertion sort.b.reports of a variety of imminent attacks on the star ship Enterprise.c.keystrokes made by a computer user writing a letter.d.symbols in an algebraic expression being evaluated.10.Inserting an item into a typical priority queue takes what big O time?11.The term priority in a priority queue means thata.the highest priority items are inserted first.b.the programmer must prioritize access to the underlying array.c.the underlying array is sorted by the priority of the items.d.the lowest priority items are deleted first.12.True or False:At least one of the methods in the priorityQ.java program (Listing4.6)uses a linear search.13.One difference between a priority queue and an ordered array is thata.the lowest-priority item cannot be extracted easily from the array as it can from the priority queue.b.the array must be ordered while the priority queue need not be.c.the highest priority item can be extracted easily from the priority queue but not from the array.d.All of the above.14.Suppose you based a priority queue class on the OrdArray class in the orderedArray.java program(Listing2.4)in Chapter2,“Arrays.”This will buy you binary search capability.If you wanted the best performance for your priority queue,would you need to modify the OrdArray class?15.A priority queue might be used to holda.passengers to be picked up by a taxi from different parts of the city.b.keystrokes made at a computer keyboard.c.squares on a chessboard in a game program.d.planets in a solar system simulation.Chapter4,Stacks and QueuesAnswers to Questions1.102.bst-In-First-Out;and First-In-First-Out4.False.It’s the other way around.5.b6.It doesn’t move at all.7.458.False.They take O(1)time.9.c10.O(N)11.c12.True13.b14.Yes,you would need a method to find the minimum value.15.aQuestionsThese questions are intended as a self-test for readers.Answers may be found in Appendix C.Questions2451.Which of the following is not true?A reference to a class objecta.can be used to access public methods in the object.b.has a size dependant on its class.c.has the data type of the class.d.does not hold the object itself.2.Access to the links in a linked list is usually through the_________link.3.When you create a reference to a link in a linked list,ita.must refer to the first link.b.must refer to the link pointed to by current.c.must refer to the link pointed to by next.d.can refer to any link you want.4.How many references must you change to insert a link in the middle of a singly linked list?5.How many references must you change to insert a link at the end of a singly linked list?6.In the insertFirst()method in the linkList.java program(Listing5.1),the statement newLink.next=first;means thata.the next new link to be inserted will refer to first.b.first will refer to the new link.c.the next field of the new link will refer to the old first link.d.newLink.next will refer to the new first link in the list.7.Assuming current points to the next-to-last link in a singly linked list,what statement will delete the last link from the list?8.When all references to a link are changed to refer to something else,what happens to the link?9.A double-ended lista.can be accessed from either end.b.is a different name for a doubly linked list.c.has pointers running both forward and backward between links.d.has its first link connected to its last link.246CHAPTER5Linked Lists10.A special case often occurs for insertion and deletion routines when a list is ________.11.Assuming a copy takes longer than a comparison,is it faster to delete an item with a certain key from a linked list or from an unsorted array?12.How many times would you need to traverse a singly linked list to delete the item with the largest key?13.Of the lists discussed in this chapter,which one would be best for implementing a queue?14.Which of the following is not true?Iterators would be useful if you wanted toa.do an insertion sort on a linked list.b.insert a new link at the beginning of a list.c.swap two links at arbitrary locations.d.delete all links with a certain key value.15.Which do you think would be a better choice to implement a stack:a singly linked list or an array?Chapter5,Linked ListsAnswers to Questions1.b2.first3.d4.25.16.c7.current.next=null;8.Java’s garbage collection process destroys it.Chapter5,Linked Lists7419.a10.empty11.a linked list12.once,if the links include a previous reference13.a double-ended list14.bually,the list.They both do push()and pop()in O(1)time,but the list uses memory more efficiently.QuestionsThese questions are intended as a self-test for readers.Answers may be found in Appendix C.1.If the user enters10in the triangle.java program(Listing6.1),what is the maximum number of“copies”of the triangle()method(actually just copies of its argument)that exist at any one time?2.Where are the copies of the argument,mentioned in question1,stored?a.in a variable in the triangle()methodb.in a field of the TriangleApp classc.in a variable of the getString()methodd.on a stack3.Assume the user enters10as in question1.What is the value of n when the triangle()method first returns a value other than1?4.Assume the same situation as in question1.What is the value of n when the triangle()method is about to return to main()?5.True or false:In the triangle()method,the return values are stored on thestack.6.In the anagram.java program(Listing6.2),at a certain depth of recursion,a version of the doAnagram()method is working with the string“led”.When this method calls a new version of itself,what letters will the new version be working with?7.We’ve seen that recursion can take the place of a loop,as in the loop-oriented orderedArray.java program(Listing2.4)and the recursive binarySearch.java program(Listing6.3).Which of the following is not true?a.Both programs divide the range repeatedly in half.b.If the key is not found,the loop version returns because the rangebounds cross,but the recursive version occurs because it reaches thebottom recursion level.c.If the key is found,the loop version returns from the entire method, whereas the recursive version returns from only one level of recursion.d.In the recursive version the range to be searched must be specified in the arguments,while in the loop version it need not be.310CHAPTER6Recursion8.In the recFind()method in the binarySearch.java program(Listing6.3),what takes the place of the loop in the non-recursive version?a.the recFind()methodb.arguments to recFind()c.recursive calls to recFind()d.the call from main()to recFind()9.The binarySearch.java program is an example of the_________approach to solving a problem.10.What gets smaller as you make repeated recursive calls in the redFind() method?11.What becomes smaller with repeated recursive calls in the towers.java program (Listing6.4)?12.The algorithm in the towers.java program involvesa.“trees”that are data storage devices.b.secretly putting small disks under large disks.c.changing which columns are the source and destination.d.moving one small disk and then a stack of larger disks.13.Which is not true about the merge()method in the merge.java program(Listing6.5)?a.Its algorithm can handle arrays of different sizes.b.It must search the target array to find where to put the next item.c.It is not recursive.d.It continuously takes the smallest item irrespective of what array it’s in.14.The disadvantage of mergesort is thata.it is not recursive.b.it uses more memory.c.although faster than the insertion sort,it is much slower than quicksort.d.it is complicated to implement.15.Besides a loop,a___________can often be used instead of recursion. Chapter6,RecursionAnswers to Questions1.102.d3.24.105.false6.“ed”7.b8.c9.divide-and-conquer10.the range of cells to search11.the number of disks to transfer12.c13.b14.b15.stackQuestionsThese questions are intended as a self-test for readers.Answers may be found in Appendix C.1.The Shellsort works bya.partitioning the array.b.swapping adjacent elements.c.dealing with widely separated elements.d.starting with the normal insertion sort.2.If an array has100elements,then Knuth’s algorithm would start with an interval of________.Questions3613.To transform the insertion sort into the Shellsort,which of the following do you not do?a.Substitute h for1.b.Insert an algorithm for creating gaps of decreasing width.c.Enclose the normal insertion sort in a loop.d.Change the direction of the indices in the inner loop.4.True or false:A good interval sequence for the Shellsort is created by repeatedly dividing the array size in half.5.Fill in the big O values:The speed of the Shellsort is more than_______but less than________.6.Partitioning isa.putting all elements larger than a certain value on one end of the array.b.dividing an array in half.c.partially sorting parts of an array.d.sorting each half of an array separately.7.When partitioning,each array element is compared to the_______.8.In partitioning,if an array element is equal to the answer to question7,a.it is passed over.b.it is passed over or not,depending on the other array element.c.it is placed in the pivot position.d.it is swapped.9.True or false:In quicksort,the pivot can be an arbitrary element of the array.10.Assuming larger keys on the right,the partition isa.the element between the left and right subarrays.b.the key value of the element between the left and right subarrays.c.the left element in the right subarray.d.the key value of the left element in the right subarray.11.Quicksort involves partitioning the original array and then_________.362CHAPTER7Advanced Sorting12.After a partition in a simple version of quicksort,the pivot may beed to find the median of the array.b.exchanged with an element of the right subarray.ed as the starting point of the next partition.d.discarded.13.Median-of-three partitioning is a way of choosing the_______.14.In quicksort,for an array of N elements,the partitionIt()method will examine each element approximately______times.15.True or false:You can speed up quicksort if you stop partitioning when the partition size is5and finish by using a different sort.Chapter7,Advanced SortingAnswers to Questions1.c2.403.d4.false5.O(N*logN),O(N2)6.a7.pivot8.d9.true10.c11.partitioning the resulting subarrays12.b13.pivot14.log2N15.trueQuestionsThese questions are intended as a self-test for readers.Answers may be found inAppendix C.1.Insertion and deletion in a tree require what big O time?2.A binary tree is a search tree ifa.every non-leaf node has children whose key values are less than(or equalto)the parent.b.every left child has a key less than the parent and every right child has akey greater than(or equal to)the parent.c.in the path from the root to every leaf node,the key of each node isgreater than(or equal to)the key of its parent.d.a node can have a maximum of two children.3.True or False:Not all trees are binary trees.4.In a complete binary tree with20nodes,and the root considered to be at level 0,how many nodes are there at level4?5.A subtree of a binary tree always hasa.a root that is a child of the main tree’s root.b.a root unconnected to the main tree’s root.c.fewer nodes than the main tree.d.a sibling with the same number of nodes.6.In the Java code for a tree,the______and the_______are generally separate classes.Questions4237.Finding a node in a binary search tree involves going from node to node, askinga.how big the node’s key is in relation to the search key.b.how big the node’s key is compared to its right or left children.c.what leaf node we want to reach.d.what level we are on.8.An unbalanced tree is onea.in which most of the keys have values greater than the average.b.whose behavior is unpredictable.c.in which the root or some other node has many more left children thanright children,or vice versa.d.that is shaped like an umbrella.9.Inserting a node starts with the same steps as_______a node.10.Suppose a node A has a successor node S.Then S must have a key that is larger than_____but smaller than or equal to_______.11.In a binary tree used to represent a mathematical expression,which of the following is not true?a.Both children of an operator node must be operands.b.Following a postorder traversal,no parentheses need to be added.c.Following an inorder traversal,parentheses must be added.d.In pre-order traversal a node is visited before either of its children.12.If a tree is represented by an array,the right child of a node at index n has an index of_______.13.True or False:Deleting a node with one child from a binary search tree involves finding that node’s successor.14.A Huffman tree is typically used to_______text.15.Which of the following is not true about a Huffman tree?a.The most frequently used characters always appear near the top of the tree.b.Normally,decoding a message involves repeatedly following a path fromthe root to a leaf.424CHAPTER8Binary Treesc.In coding a character you typically start at a leaf and work upward.d.The tree can be generated by removal and insertion operations on apriority queue.Chapter8,Binary TreesAnswers to Questions1.O(logN)2.b3.True4.55.c6.node,tree7.a8.cChapter8,Binary Trees7439.finding10.A,A’s left-child descendents11.d12.2*n+113.Falsepress15.cQuestionsThese questions are intended as a self-test for readers.Answers may be found in Appendix C.1.A2-3-4tree is so named because a node can havea.three children and four data items.b.two,three,or four children.c.two parents,three children,and four items.d.two parents,three items,and four children.2.A2-3-4tree is superior to a binary search tree in that it is________.3.Imagine a parent node with data items25,50,and75.If one of its child nodes had items with values60and70,it would be the child numbered__________.4.True or False:Data items are located exclusively in leaf nodes.514CHAPTER102-3-4Trees and External Storage5.Which of the following is not true each time a node is split?a.Exactly one new node is created.b.Exactly one new data item is added to the tree.c.One data item moves from the split node to its parent.d.One data item moves from the split node to its new sibling.6.A2-3-4tree increases its number of levels when________.7.Searching a2-3-4tree does not involvea.splitting nodes on the way down if necessary.b.picking the appropriate child to go to,based on data items in a node.c.ending up at a leaf node if the search key is not found.d.examining at least one data item in any node visited.8.After a non-root node of a2-3-4tree is split,does its new right child contain the item previously numbered0,1,or2?9.A4-node split in a2-3-4tree is equivalent to a_______in a red-black tree.10.Which of the following statements about a node-splitting operation in a2-3 tree(not a2-3-4tree)is not true?a.The parent of a split node must also be split if it is full.b.The smallest item in the node being split always stays in that node.c.When the parent is split,child2must always be disconnected from itsold parent and connected to the new parent.d.The splitting process starts at a leaf and works upward.11.What is the big O efficiency of a2-3tree?12.In accessing data on a disk drive,a.inserting data is slow but finding the place to write data is fast.b.moving data to make room for more data is fast because so many items can be accessed at once.c.deleting data is unusually fast.d.finding the place to write data is comparatively slow but a lot of data can be written quickly.13.In a B-tree each node contains_______data items.Questions51514.True or False:Node splits in a B-tree have similarities to node splits in a2-3 tree.15.In external storage,indexing means keeping a file ofa.keys and their corresponding blocks.b.records and their corresponding blocks.c.keys and their corresponding records.st names and their corresponding keys.Chapter9,Red-Black TreesAnswers to Questions1.in order(or inverse order)2.b3.False4.d5.b6.rotations,changing the colors of nodes7.red8.a9.left child,right child10.d11.a node,its two children12.b13.True14.a15.TrueQuestionsThese questions are intended as a self-test for readers.Answers may be found in Appendix C.574CHAPTER11Hash Tablesing big O notation,say how long it takes(ideally)to find an item in a hash table.2.A__________transforms a range of key values into a range of index values.3.Open addressing refers toa.keeping many of the cells in the array unoccupied.b.keeping an open mind about which address to use.c.probing at cell x+1,x+2,and so on until an empty cell is found.d.looking for another location in the array when the one you want is occupied.ing the next available position after an unsuccessful probe is called_____________.5.What are the first five step sizes in quadratic probing?6.Secondary clustering occurs becausea.many keys hash to the same location.b.the sequence of step lengths is always the same.c.too many items with the same key are inserted.d.the hash function is not perfect.7.Separate chaining involves the use of a_____________at each location.8.A reasonable load factor in separate chaining is________.9.True or False:A possible hash function for strings involves multiplying each character by an ever-increasing power.10.The best technique when the amount of data is not well known isa.linear probing.b.quadratic probing.c.double hashing.d.separate chaining.11.If digit folding is used in a hash function,the number of digits in each group should reflect_____________.12.True or False:In linear probing an unsuccessful search takes longer than a successful search.Questions57513.In separate chaining the time to insert a new itema.increases linearly with the load factor.b.is proportional to the number of items in the table.c.is proportional to the number of lists.d.is proportional to the percentage of full cells in the array.14.True or False:In external hashing,it’s important that the records don’t become full.15.In external hashing,all records with keys that hash to the same value are located in___________.Chapter11,Hash TablesAnswers to Questions1.O(1)2.hash function3.d4.linear probing5.1,4,9,16,256.b7.linked listChapter11,Hash Tables7458.1.09.True10.d11.the array size12.False13.a14.False15.the same blockQuestionsThese questions are intended as a self-test for readers.Answers may be found in Appendix C.1.What does the term complete mean when applied to binary trees?a.All the necessary data has been inserted.b.All the rows are filled with nodes,except possibly the bottom one.c.All existing nodes contain data.d.The node arrangement satisfies the heap condition.2.What does the term weakly ordered mean when applied to heaps?3.A node is always removed from the__________.4.To“trickle up”a node in a descending heap meansa.to repeatedly exchange it with its parent until it’s larger than its parent.b.to repeatedly exchange it with its child until it’s larger than its child.c.to repeatedly exchange it with its child until it’s smaller than its child.d.to repeatedly exchange it with its parent until it’s smaller than its parent.5.A heap can be represented by an array because a heap。
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
Test for Chapter 1
I. Complete the words according to the requirements. 10%
1. [ˈsætədeɪ] /[ˈsætədɪ]
2. [ˈeɪprəl]
3. autumn
4. spaghetti
5. videos
6. stole
7. bracelet
8. forgot
9. [ˈsi:zn] 10. laid
II. Write down the words according to the English explanations. 10%
1. van
2. communicate
3. coast
4. anniversary
5. briefcase
6. condominium
7. plant
8. perfume
9. really 10. advice
III. Complete the sentence with the correct form of phrases given in the column. 20%
1. goes to church
2. communicated with my niece
3. live far apart
4. is going to give her a purple blouse with pink polka dots
5. makes pancakes
6. gave me advice
7. is going to go skiing
8. chatting
9. sent; lent 10. swam
IV. Texts. 10%
1.writes her letters about life on the West Coast; writes him letters about life
on the East Coast
2.sent her some CDs; sent him a wallet
3.lent her money; gave him advice
4.went to church together; took vacations together
5.send them messages; send us messages about life down south.
V. Rewrite the following sentence as required. (5%)
1. What an exciting week it was!
2. How often did they go to Australia?
3. He was seen swimming in Qianling Lake yesterday (by someone).
4. They don’t need any more workers to build the bridge.
5. Did the book cost him three dollars?
VI. Multiple choice. 15%
1-5 ABAAC 6-10 DDBCA 11-15 AADDC
VII. Cloze. 10%
1-5 CCDBA 6-10 BACDC
VIII. Reading. 10%
DBBCC
IX. Fill in the blanks with the correct forms of the words by using the initial letter of them. 10%
71. century 72. it 73. remembered 74. but 75. changed 76. because 77. words 78. matter 79. helping 80. cameras。