Algorithms_and_Data_Structures_09

Algorithms_and_Data_Structures_09 - Lecture 9 Computer...

Info iconThis preview shows pages 1–11. Sign up to view the full content.

View Full Document Right Arrow Icon
Computer Science Algorithms and Data Structures Prof. Dr. Andreas Nüchter Research I, Room 105 Jacobs University Bremen http://www.nuechti.de andreas@nuechti.de Lecture 9
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Algorithms and Data Structures Dr. Andreas Nüchter October 1, 2009 299 Announcements (1) Midterm October 15 14:15-15:30 Remember grading policy: Assignments: 20% of the final grade Midterm: 30% of the final grade Final exam: 50% of the final grade Midterm has 3 parts: 1. Applying discussed algorithms to problems 2. Solving problems similar to homework 3. Solving new problems October 8 review and discussion session Prepare a handwritten A5 ( 148 mm × 210 mm ) crib/cheat sheet
Background image of page 2
Algorithms and Data Structures Dr. Andreas Nüchter October 1, 2009 300 Announcements (2) Programming Assignment is out! Use C/C++ as programming language and make use of the code I am providing! Work in Pairs! You have to demonstrate the software to the TAs Make an appointment with one of the TAs! Write your and you partner’s name in the list @ my office door!
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Algorithms and Data Structures Dr. Andreas Nüchter October 1, 2009 301 Last Lecture Formal proof of the theorem: Theorem : The average number of comparisons for sorting keys is We need to minimize the path length of the corresponding decision tree An optimal decision tree has two child nodes for a comparison node Sorting in linear time with counting sort Introduction to Data Structures
Background image of page 4
Algorithms and Data Structures Dr. Andreas Nüchter October 1, 2009 302 Queues Dynamic set Delete operation is called de-queue Inset operation is called en-queue FIFO principle (First In First Out), i.e., the element that is removed from the queue is the oldest one in the queue. Queue can also be realized using an array Queue with 5 elements at the places
Background image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Algorithms and Data Structures Dr. Andreas Nüchter October 1, 2009 303 Queues after the operations , and returns the value 15.
Background image of page 6
Algorithms and Data Structures Dr. Andreas Nüchter October 1, 2009 304 Queues
Background image of page 7

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Algorithms and Data Structures Dr. Andreas Nüchter October 1, 2009 305 Pointer in C/C++
Background image of page 8
Algorithms and Data Structures Dr. Andreas Nüchter October 1, 2009 306 Pointer in C/C++ Address A place in memory, where the data is stored The address of variable x is obtained by Pointer A variable that holds an address int i = 10; int * j = i; /* j "points" to i */ 0x123aa8 10 0x123aa8 i name address contents 0x123aab j
Background image of page 9

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Algorithms and Data Structures Dr. Andreas Nüchter October 1, 2009 307 Pointer in C/C++ The data to which a pointer points is accessable with the * -operator is the address of i *j is the content of the memory at place j * -operator for dereferencing Meanings of * in C/C++ 1. Multiplication 2. Declaration of a pointer 3. Dereferencing int i = 10; int *j = &i; printf("i = %d\n", i); printf("j = %x\n", j); printf("j points to: %d\n", * j);
Background image of page 10
Image of page 11
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 05/04/2010 for the course CS 320251 taught by Professor Nuechter during the Fall '09 term at Jacobs University Bremen.

Page1 / 52

Algorithms_and_Data_Structures_09 - Lecture 9 Computer...

This preview shows document pages 1 - 11. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online