The algorithms must be written for the

  • No School
  • AA 1
  • 28

This preview shows page 15 - 28 out of 28 pages.

The algorithms must be written for the responsibilities Knowledge responsibilities usually just return the contents of one of an object’s variables Action responsibilities are a little more complicated, often involving calculations Design and Analysis of Algorithm 15
Image of page 15
16 Trace the algorithm on the input given.
Image of page 16
17
Image of page 17
18 A path in a multigraph that traverses all the edges exactly once and returns to a starting vertex. Such paths are called Eulerian circuits ; if a path traverses all the edges exactly once but does not return to its starting vertex, it is called an Eulerian path .
Image of page 18
Euler proved that an Eulerian circuit exists in a connected (multi)graph if and only if all its vertices have even degrees, where the degree of a vertex is defined as the number of edges for which it is an endpoint. Eulerian path exists in a connected (multi)graph if and only if it has exactly two vertices of odd degrees; such a path must start at one of those two vertices and end at the other. 19
Image of page 19
Fundamental Data Structures Linear Data Structures Graphs Trees Sets and Dictionaries 20
Image of page 20
Linear Data Structures 21
Image of page 21
Assume you have a single linked list with a forward pointer at each node as shown in the following diagram. Assume you are given a pointer of a node somewhere in the liked list as shown in the figure. How one can implement the delete p th node operations in such a way that the time it takes does not depend on the array’s size n or it does not depend where p is in the list. 22 p
Image of page 22
Graphs 23
Image of page 23
Weighted Graphs Paths & Cycles Graph Traversal 24
Image of page 24
Trees 25
Image of page 25
Rooted Trees 26
Image of page 26
Sets & Dictionary 27
Image of page 27
Solve Exercise 1.4 28 Assignment # 3
Image of page 28

You've reached the end of your free preview.

Want to read all 28 pages?

  • Fall '19

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern

Stuck? We have tutors online 24/7 who can help you get unstuck.
A+ icon
Ask Expert Tutors You can ask You can ask ( soon) You can ask (will expire )
Answers in as fast as 15 minutes
A+ icon
Ask Expert Tutors