11 Pages

Course Number: CS 123, Fall 2007

College/University: Carnegie Mellon

Word Count: 2604

Rating:

###### Document Preview

Lecture 09 C Structs and Linked Lists In this lecture Structs in C operator Structs within BMP files Reading Header information from BMP files Passing structs to functions Passing pointer to structs Array of structs and Array of struct pointers Concept of a linked list Types of Linked List Implementation Further readings Exercises Answers Structs in C Structs in C are used to package several data...

##### Unformatted Document Excerpt
Coursehero >> Pennsylvania >> Carnegie Mellon >> CS 123

Course Hero has millions of student submitted documents similar to the one
below including study guides, practice problems, reference materials, practice exams, textbook help and tutor support.

Course Hero has millions of student submitted documents similar to the one below including study guides, practice problems, reference materials, practice exams, textbook help and tutor support.

Find millions of documents on Course Hero - Study Guides, Lecture Notes, Reference Materials, Practice Exams and more. Course Hero has millions of course specific materials providing students with the best way to expand their education.

Below is a small sample set of documents:

Carnegie Mellon - CS - 123
Lecture 10 Linked List OperationsIn this lecture Concept of a linked list revisited Types of Linked Lists Designing a node of a Linked List Operations on Linked Lists o Appending a node to a Linked List o Prepending a node to a linked list o Inserting a
Carnegie Mellon - CS - 123
Lecture 11 Array of Linked ListsIn this lecture Array of Linked Lists Creating an Array of Linked Lists Representing a Sparse Matrix Defining a Node for Sparse Matrix Exercises SolutionsAn Array of Linked ListsA linked list is defined as a collection o
Carnegie Mellon - CS - 123
Lecture 12 Doubly Linked Lists (with Recursion)In this lecture Introduction to Doubly linked lists What is recursion? Designing a node of a DLL Recursion and Linked Lists o Finding a node in a LL (recursively) o Printing a LL (recursively) o Appending a
Carnegie Mellon - CS - 123
Lecture 13 Function Pointers In this lecture Functions with variable number of arguments Introduction to function pointers Example of passing a function pointer to a function (qsort) Defining a function pointer Generic Data Types Functions with variable n
Carnegie Mellon - CS - 123
Lecture 14 Generic Data Structures In this lecture Introduction to Generic Data structures Examples An Introduction to Generic Data StructuresPrograms use many different data structures such as arrays, linked lists, hash tables, general trees, binary sea
Carnegie Mellon - CS - 123
Lecture 15 Introduction to HashingWhy Hashing? Internet has grown to millions of users generating terabytes of content every day. According to internet data tracking services, the amount of content on the internet doubles every six months. With this kind
Carnegie Mellon - CS - 123
Lecture 16More on HashingCollision ResolutionIntroduction In this lesson we will discuss several collision resolution strategies. The key thing in hashing is to find an easy to compute hash function. However, collisions cannot be avoided. Here we discu
Carnegie Mellon - CS - 123
Lecture 17 Bit OperationsIn this lecture Background Left Shifting Negative Numbers, complement Right Shifting Bit Operators Masking the Bits Getting the Bits Setting the Bits Binary Files Bit fields More ExercisesonescomplementandtwosC is a powerful
Carnegie Mellon - CS - 123
Lecture 18 Regular ExpressionsMany of todays web applications require matching patterns in a text document to look for specific information. A good example is parsing a html file to extract &lt;img&gt; tags of a web document. If the image locations are availab
Carnegie Mellon - CS - 123
Lecture 19 Perl ProgrammingPerl (Practical Extraction and Report Language) is a powerful and adaptable scripting language. Perl became very popular in early 90s as web became a reality. Perl is ideal for processing text files containing strings. Perl is
Carnegie Mellon - CS - 123
Lecture 20 Advanced Perl ProgrammingIn the previous lecture, we learned some basic constructs of perl programming including regex processing in Perl. Combining regex constructs with other high level programming capabilities of Perl is one of the main adv
Carnegie Mellon - CS - 123
Lecture 21 Systems Programming in CA C program can invoke UNIX system calls directly. A system call can be defined as a request to the operating system to do something on behalf of the program. During the execution of a system call, the mode is change fr
Carnegie Mellon - CS - 123
Lecture 22 Systems Programming Process ControlA process is defined as an instance of a program that is currently running. A uni processor system can still execute multiple processes giving the appearance of a multiprocessor machine. A call to a program s
Carnegie Mellon - CS - 123
Ananda GunawardenaLecture 23 Assembler FundamentalsAll programs written in a high-level language like C are converted into machine language so they can be executed by the underlying hardware. However, the process of converting high level source code to
Carnegie Mellon - CS - 123
Ananda GunawardenaLecture 31 C and AssemblyHigh level languages are designed to allow programmers to write programs in a way that is closer to the logical thinking of the program flow. However, programming in assembly language requires programmers to un
Carnegie Mellon - CS - 123
Ananda GunawardenaLecture 25 Course ReviewFinal Exam is given during 5 reserved time slots in wean 5419.05-04 05-06 05-08 05-12 MON WED THU TUE 1:00pm-4:00pm 1:00pm-4:00pm 1:00pm-4:00pm 1:00pm-4:00pm (Hub Schedule time)You need to signup for one of th
Carnegie Mellon - CS - 123
Ananda GunawardenaLecture 26 Course Review IIPerl Programming Basics This is only a partial list of tasks that you should know. Anything else can be found by using the man pages &gt; man perl and use the specific pages to find information. For example, &gt;ma
Carnegie Mellon - CS - 123
import java.io.*; import java.util.*; public class javasort cfw_ public static void main(String[] args) throws Exception cfw_ long begin, end; begin = System.currentTimeMillis(); int n = Integer.parseInt(args[0]); int[] A = new int[n]; Random R = new Rand
UCSB - PHYS - PHYS 4
Page 1 of 14mhtml:file:/C:\Documents and Settings\easyPDFUser\Local Settings\Temp\BCL Technol.4/15/2009Page 2 of 14mhtml:file:/C:\Documents and Settings\easyPDFUser\Local Settings\Temp\BCL Technol.4/15/2009Page 3 of 14mhtml:file:/C:\Documents and S
UCSB - PHYS - PHYS 4
UCSB - PHYS - PHYS 4
Page 1 of 16mhtml:file:/C:\Documents%20and%20Settings\easyPDFUser\Local%20Settings\Temp\B.1/15/2009Page 2 of 16mhtml:file:/C:\Documents%20and%20Settings\easyPDFUser\Local%20Settings\Temp\B.1/15/2009Page 3 of 16mhtml:file:/C:\Documents%20and%20Setti
UCSB - PHYS - PHYS 4
Page 1 of 14mhtml:file:/C:\Documents%20and%20Settings\easyPDFUser\Local%20Settings\Temp\B.1/28/2009Page 2 of 14mhtml:file:/C:\Documents%20and%20Settings\easyPDFUser\Local%20Settings\Temp\B.1/28/2009Page 3 of 14mhtml:file:/C:\Documents%20and%20Setti
UCSB - PHYS - PHYS 4
UCSB - PHYS - PHYS 4
Page 1 of 23mhtml:file:/C:\Documents%20and%20Settings\easyPDFUser\Local%20Settings\Temp\B.2/10/2009Page 2 of 23mhtml:file:/C:\Documents%20and%20Settings\easyPDFUser\Local%20Settings\Temp\B.2/10/2009Page 3 of 23mhtml:file:/C:\Documents%20and%20Setti
UCSB - PHYS - PHYS 4
Page 1 of 10mhtml:file:/C:\Documents%20and%20Settings\easyPDFUser\Local%20Settings\Temp\B.2/20/2009Page 2 of 10mhtml:file:/C:\Documents%20and%20Settings\easyPDFUser\Local%20Settings\Temp\B.2/20/2009Page 3 of 10mhtml:file:/C:\Documents%20and%20Setti
UCSB - PHYS - PHYS 4
UCSB - PHYS - PHYS 4
Page 1 of 4mhtml:file:/C:\Documents%20and%20Settings\easyPDFUser\Local%20Settings\Temp\BC. 3/4/2009Page 2 of 4mhtml:file:/C:\Documents%20and%20Settings\easyPDFUser\Local%20Settings\Temp\BC. 3/4/2009Page 3 of 4mhtml:file:/C:\Documents%20and%20Settings
UCSB - PHYS - PHYS 4
UCSB - PHYS - PHYS 4
UCSB - PHYS - PHYS 2
Physics 2 Summer Session 2008 Quiz # 1Question 1 Let A = 4i + 6j and B = 2i + k. C = A x B is given by (a) (b) (c) (d) (e) 8i 6i 4j 12k 6i + 6j + k 6i + 4j + 12k none of the above(4i + 6j) x (2i + k) = 8 (i x i) + 4 (i x k) + 12 (j x i) + 6 (j x k) = 8
UCSB - PHYS - PHYS 2
Physics 2 Summer Session 2008 Quiz # 3 SolutionsQuestion 1 The path of each planet about the sun is an ellipse with the sun at (a) (b) (c) (d) the center one focus centered between the two foci on the apexCorrect answer is (b) Question 2 In the Simple H
UCSB - PHYS - PHYS 2
Physics 2 Summer Session 2008 Quiz # 4Question 1 Object A has twice the density and half the mass of object B. The ratio of the volume of A to the volume of B is (a) (b) 1 (c) Mass = Density x Volume Volume = Mass/Density. (d) 2 (e) 4Correct answer is (
UCSB - PHYS - PHYS 2
Physics 2 Summer Session 2008 Quiz # 5Question 1 Consider four objects A, B, C, and D. It is found that A and B are in thermal equilibrium. It is also found that C and D are in thermal equilibrium. However, A and C are not in thermal equilibrium. One can
UCSB - PHYS - PHYS 2
Physics 2 Summer 2008 FinalEnter solutions to the two problems in the blue book. Each problem is worth 15 points. (2 x 15 = 30). Enter answers to the 14 multiple choice questions in the scantron. The multiple choice questions are worth 70 points, total (
UCSB - PHYS - PHYS 2
UCSB - PHYS - PHYS 2
Physics 2 Summer 2008 MidtermEnter solutions to the two problems in the blue book. Each problem is worth 20 points. (2 x 20 = 40). Enter answers to the 15 multiple choice questions in the scantron. The multiple choice questions are worth 60 points, total
UCSB - PHYS - PHYS 2
Physics 2 MidtermDo not turn this page until you are instructed to do soPhysics 2 Spring 2009 Midterm Test Form AEnter solutions in the scantron. There is no penalty for wrong answers. Make sure to enter the test form in your scantronQuestion 1 Imagin
UCSB - PHYS - PHYS 2
UCSB - PHYS - PHYS 2
Cornell - BIOEE - 2780
Evolutionary Biology: Section Assignment Visit the Museum of the EarthVisit the Museum of the Earth and complete this worksheet You may visit the museum at your convenience between September 19th 27th This assignment is due in section during the week of
Cornell - BIOEE - 2780
11.Thecriticalmissingcomponentofthisstudyisaconsiderationofthehistorical(= evolutionary;phylogenetic)similaritiesamongthesebirdspecies,andtheuseof comparativeanalysis(=phylogenetic)methodstotakethoserelationshipsintoaccount whentestingforarelationshipb
Cornell - BIOEE - 2780
1. WhichofthefollowingstatementsisTRUE: Microevolutionarychangealwaysrequiresgeneticvariationtobepresentinapopulation. 2. Imaginethatyoucreatearandomlymating,infinitelysized,sexual,diploidpopulationwhere 80%ofthefoundingindividualsareAAand20%areAa.Afterth
Cornell - BIOEE - 2780
POPULATION GENETICS - PRACTICE PROBLEMS KEYFALL 2009These problems are designed to help you understand the concepts covered in lecture and section. However, merely completing this set of practice problems is not sucient preparation for the exam be sure
Cornell - BIOEE - 2780
POPULATION GENETICS - PRACTICE PROBLEMSFALL 2009These problems are designed to help you understand the concepts covered in lecture and section. However, merely completing this set of practice problems is not sucient preparation for the exam be sure to r
Cornell - BIOEE - 2780
Cornell - BIOEE - 2780
Cornell - BIOEE - 2780
For grading use only BioEE 2780_ mc_ 11_ 12_ 13_ 14exam total: _ /100 pts possibleYOUR NAME _PLEASE PRINT CLEARLYMidterm I October 7, 2008INSTRUCTIONS Do not open the exam until you are told to do so. Be sure to print your name on this page and
Cornell - BIOEE - 2780
1. Cyanobacteria had a notable influence on their environment because: a) they were able to use H2S from thermal vents to produce energy b) they had the metabolic capacity to consume oxygen from a super-saturated atmosphere c) they developed a photosystem
Cornell - BIOEE - 2780
1. (T/F) Since choroplasts are descendants of ancient prokaryotes, they are valuable characters for establishing the phylogenetic history of eukaryotes. Answer: FALSE - they can be lost (in lecture handout) 2. You are worried the potatoes you planted this
Cornell - BIOEE - 2780
Which fungi phyla form mycorrhizae? A. Ascomycota B. Basidiomycota C. Glomeromycota D. B &amp; C E. A, B &amp; C Which of the following is not a synapomorphy for Kingdom Animalia? A. distinctive collagen B. desmosomes C. Hox genes D. nerves E. muscles Which of th
Cornell - BIOEE - 2780
BioEE 2780 Evolutionary Biology &amp; DiversityFall 2009 Irby Lovette (lead professor)When you have seen one ant, one bird, one tree, you have not seen them all. biologist E. O. Wison Nothing in Biology makes sense but in the light of Evolution. geneticist
Cornell - CHEM - 3570
Chem 1057 J. WalcottCENTER FOR LEARNING AND TEACHING LEARNING STRATEGIES CENTER Fall 2009Review Guide #1Chapter 1I. Review of Concepts from General Chemistry A. An atomic orbital is a description of the wave properties of an electron in an atom. A thr
Cornell - CHEM - 3570
Chem 1057 J. WalcottCENTER FOR LEARNING AND TEACHING LEARNING STRATEGIES CENTER Fall 2009Review Guide #2Lecture: 8/31/09 9/4/09: Chapter 1I. Lewis Structures and Formal Charges Please refer to Review Guide #1 for the general procedure for writing Lewi
Cornell - CHEM - 3570
Chem 1057 J. WalcottCENTER FOR LEARNING AND TEACHING LEARNING STRATEGIES CENTER Fall 2009Review Guide #3Lectures: 9/7/09 9/11/09 Chapter 2I. Hydrocarbons Hydrocarbons are compounds that contain only the elements carbon and hydrogen. Alkanes are alipha
Cornell - CHEM - 3570
Chem 1057 J. Walcott LEARNING STRATEGIES CENTER Fall 2009Review Guide #4Lectures: 9/14/09 9/18/09 and Chapters 3 and 5I. Alkenes 2 Any molecule with a carbon - carbon double bond is an alkene. The carbons are sp hybridized with bond angles of 120. Six
Cornell - CHEM - 3570
Chem 1057 J. Walcott LEARNING STRATEGIES CENTER Fall 2009Review Guide #5Lectures: 9/21/09 9/25/09: Chapter 4I. Alkene Stability Alkyl substiuents bonded to the sp carbons of an alkene have a stabilizing effect on the alkene due to hyperconjugation. The
Cornell - CHEM - 3570
Chem 1057 J. Walcott LEARNING STRATEGIES CENTER Fall 2009Review Guide #6Lectures: 9/28/09 10/2/09: Chapters 4 and 5I. Three types of Alkene Addition Reactions (continued from Review Guide #5) A. Syn-Anti Addition 1. Hydrohalogenation (add HX) 2. Hydrat
Cornell - CHEM - 3570
Chem1057 J. Walcott LEARNING STRATEGIES CENTER Fall 2009Review Guide #7Lectures: 10/5/09 10/16/09: Chapters 4, 6 and 7I. Alkene Addition Reactions (continued from Review Guide #6) A. Syn-Anti Addition 1. Hydrohalogenation (adds H-X) 2. Hydration (adds
Cornell - CHEM - 3570
Chem 1057 J. Walcott LEARNING STRATEGIES CENTER Fall 2009Review Guide #8Lectures: 10/19/09 10/23/09: Chapters 7 and 8I. The Diels Alder Reaction Conjugated dienes undergo cycloaddtion reactions with dienophiles to give cyclic products. The four carbon
Cornell - CHEM - 3570
Chem 1057 J. Walcott LEARNING STRATEGIES CENTER Fall 2009Review Guide #9Lectures: 10/26/09 10/30/09 : Chapters 8 and 9I. Reactions of Alkyl Halides ( Please see Review Guide #8 for SN2 and E2 Reactions) A. The SN2 Reaction 1. The nucleophile replaces t
Cornell - CHEM - 3570
Chem 1057 J. Walcott LEARNING STRATEGIES CENTER Fall 2009Review Guide #10Lectures: 11/2/09 11/6/09: Chapters 10 and 11I. Ethers Ethers are generally unreactive and thereby are often used as solvents. A. Preparation 1. The Williamson ether synthesis is