We may earn an affiliate commission when you visit our partners.
Course image
Kevin Wayne and Robert Sedgewick

This course covers the essential information that every serious programmer needs to know about algorithms and data structures, with emphasis on applications and scientific performance analysis of Java implementations. Part I covers elementary data structures, sorting, and searching algorithms. Part II focuses on graph- and string-processing algorithms.

Read more

This course covers the essential information that every serious programmer needs to know about algorithms and data structures, with emphasis on applications and scientific performance analysis of Java implementations. Part I covers elementary data structures, sorting, and searching algorithms. Part II focuses on graph- and string-processing algorithms.

All the features of this course are available for free. People who are interested in digging deeper into the content may wish to obtain the textbook Algorithms, Fourth Edition (upon which the course is based) or visit the website algs4.cs.princeton.edu for a wealth of additional material.

This course does not offer a certificate upon completion.

Enroll now

What's inside

Syllabus

Course Introduction
Welcome to Algorithms, Part I.
Union−Find
We illustrate our basic approach to developing and analyzing algorithms by considering the dynamic connectivity problem. We introduce the union−find data type and consider several implementations (quick find, quick union, weighted quick union, and weighted quick union with path compression). Finally, we apply the union−find data type to the percolation problem from physical chemistry.
Read more
Analysis of Algorithms
The basis of our approach for analyzing the performance of algorithms is the scientific method. We begin by performing computational experiments to measure the running times of our programs. We use these measurements to develop hypotheses about performance. Next, we create mathematical models to explain their behavior. Finally, we consider analyzing the memory usage of our Java programs.
Stacks and Queues
We consider two fundamental data types for storing collections of objects: the stack and the queue. We implement each using either a singly-linked list or a resizing array. We introduce two advanced Java features—generics and iterators—that simplify client code. Finally, we consider various applications of stacks and queues ranging from parsing arithmetic expressions to simulating queueing systems.
Elementary Sorts
We introduce the sorting problem and Java's Comparable interface. We study two elementary sorting methods (selection sort and insertion sort) and a variation of one of them (shellsort). We also consider two algorithms for uniformly shuffling an array. We conclude with an application of sorting to computing the convex hull via the Graham scan algorithm.
Mergesort
We study the mergesort algorithm and show that it guarantees to sort any array of n items with at most n lg n compares. We also consider a nonrecursive, bottom-up version. We prove that any compare-based sorting algorithm must make at least n lg n compares in the worst case. We discuss using different orderings for the objects that we are sorting and the related concept of stability.
Quicksort
We introduce and implement the randomized quicksort algorithm and analyze its performance. We also consider randomized quickselect, a quicksort variant which finds the kth smallest item in linear time. Finally, we consider 3-way quicksort, a variant of quicksort that works especially well in the presence of duplicate keys.
Priority Queues
We introduce the priority queue data type and an efficient implementation using the binary heap data structure. This implementation also leads to an efficient sorting algorithm known as heapsort. We conclude with an applications of priority queues where we simulate the motion of n particles subject to the laws of elastic collision.
Elementary Symbol Tables
We define an API for symbol tables (also known as associative arrays, maps, or dictionaries) and describe two elementary implementations using a sorted array (binary search) and an unordered list (sequential search). When the keys are Comparable, we define an extended API that includes the additional methods min, max floor, ceiling, rank, and select. To develop an efficient implementation of this API, we study the binary search tree data structure and analyze its performance.
Balanced Search Trees
In this lecture, our goal is to develop a symbol table with guaranteed logarithmic performance for search and insert (and many other operations). We begin with 2−3 trees, which are easy to analyze but hard to implement. Next, we consider red−black binary search trees, which we view as a novel way to implement 2−3 trees as binary search trees. Finally, we introduce B-trees, a generalization of 2−3 trees that are widely used to implement file systems.
Geometric Applications of BSTs
We start with 1d and 2d range searching, where the goal is to find all points in a given 1d or 2d interval. To accomplish this, we consider kd-trees, a natural generalization of BSTs when the keys are points in the plane (or higher dimensions). We also consider intersection problems, where the goal is to find all intersections among a set of line segments or rectangles.
Hash Tables
We begin by describing the desirable properties of hash function and how to implement them in Java, including a fundamental tenet known as the uniform hashing assumption that underlies the potential success of a hashing application. Then, we consider two strategies for implementing hash tables—separate chaining and linear probing. Both strategies yield constant-time performance for search and insert under the uniform hashing assumption.
Symbol Table Applications
We consider various applications of symbol tables including sets, dictionary clients, indexing clients, and sparse vectors.

Good to know

Know what's good
, what to watch for
, and possible dealbreakers
Teaches algorithm analysis which is highly relevant to computer science
Develops algorithms and data structures, which are core skills for computer science
Taught by Robert Sedgewick and Kevin Wayne, who are recognized for their work in algorithms and data structures
Covers essential information every programmer needs to know
Uses Java implementations, which makes it immediately accessible to learners
Provides a wealth of additional material for those who want to dig deeper

Save this course

Save Algorithms, Part I to your list so you can find it easily later:
Save

Reviews summary

Algorithms i: essentials

learners say Algorithms, Part I is an engaging, challenging course covering fundamental topics in algorithms and data structures, ideal for students with some programming background and a desire to deepen their understanding. Through structured lectures, engaging assignments, and detailed explanations, the course imparts essential knowledge and skills. Highlights of the course include: - **Comprehensive Coverage**: The course comprehensively explores fundamental data structures like arrays, stacks, queues, trees, and graphs, along with essential algorithms for sorting, searching, and graph traversal. - **Engaging Lectures**: Led by renowned Professor Robert Sedgewick, the lectures clearly explain concepts with intuitive examples and animations, making complex topics accessible and enjoyable to grasp. - **Challenging Assignments**: Weekly programming assignments provide practical application of concepts learned in lectures, helping students solidify their understanding and develop problem-solving skills. - **Expert Feedback**: An automated grading system provides detailed feedback on assignments, highlighting errors and guiding students towards improvement. The active discussion forums offer support from TAs and peers, fostering a collaborative learning environment. - **Real-World Applications**: The course emphasizes the practical relevance of algorithms and data structures, showcasing their applications in various fields such as computational geometry, physics, and network analysis. Students appreciate the course's well-structured content, clear explanations, and challenging assignments that encourage critical thinking and problem-solving. While some assignments can be time-consuming, the sense of accomplishment upon completion is highly rewarding. The course effectively prepares students for further studies in algorithms and data structures and enhances their programming proficiency. Some students have noted that prior knowledge of programming concepts, particularly in Java, is beneficial for the course. Additionally, the course requires a significant time commitment, with assignments often taking longer than the estimated time. However, the comprehensive learning experience and the opportunity to master fundamental algorithms and data structures make this course highly recommended for motivated learners seeking to strengthen their programming skills.
The content is largely positive.
"learners say Algorithms, Part I is an engaging, challenging course covering fundamental topics in algorithms and data structures, ideal for students with some programming background and a desire to deepen their understanding."
"Highlights of the course include: - **Comprehensive Coverage**: The course comprehensively explores fundamental data structures like arrays, stacks, queues, trees, and graphs, along with essential algorithms for sorting, searching, and graph traversal."
"Led by renowned Professor Robert Sedgewick, the lectures clearly explain concepts with intuitive examples and animations, making complex topics accessible and enjoyable to grasp."
"Weekly programming assignments provide practical application of concepts learned in lectures, helping students solidify their understanding and develop problem-solving skills."
"An automated grading system provides detailed feedback on assignments, highlighting errors and guiding students towards improvement."
"The active discussion forums offer support from TAs and peers, fostering a collaborative learning environment."
"The course emphasizes the practical relevance of algorithms and data structures, showcasing their applications in various fields such as computational geometry, physics, and network analysis."
"Students appreciate the course's well-structured content, clear explanations, and challenging assignments that encourage critical thinking and problem-solving."
The content is largely negative.
"Some students have noted that prior knowledge of programming concepts, particularly in Java, is beneficial for the course."
"Additionally, the course requires a significant time commitment, with assignments often taking longer than the estimated time."

Activities

Be better prepared before your course. Deepen your understanding during and after it. Supplement your coursework and achieve mastery of the topics covered in Algorithms, Part I with these activities:
Follow Tutorials on Merge Sort
Explore online tutorials on merge sort to gain a deeper understanding of its implementation, performance analysis, and applications.
Browse courses on Merge Sort
Show steps
  • Search for tutorials on merge sort
  • Follow along with the tutorial explanations
  • Implement merge sort in Java to practice the concepts
Write a Summary of Union-Find Algorithms
Summarize the key concepts and implementation details of union-find algorithms to strengthen your understanding of disjoint-set operations.
Show steps
  • Review the course materials on union-find algorithms
  • Identify the main concepts and algorithms
  • Write a concise summary in your own words
Compile a Resource List of Java Libraries
Gather and organize a list of useful Java libraries that can enhance your programming skills and project development.
Browse courses on Java Libraries
Show steps
  • Research and identify relevant Java libraries
  • Categorize libraries based on their functionalities
  • Create a documentation or spreadsheet to store the information
Four other activities
Expand to see all activities and additional details
Show all seven activities
Solve LeetCode Problems
Practice solving coding problems on LeetCode to reinforce your understanding of algorithm design and data structure implementation techniques.
Browse courses on Algorithms
Show steps
  • Create a LeetCode account
  • Choose a problem to solve
  • Implement the solution using Java
  • Submit your solution and review the results
Implement a Binary Search Tree
Create a Java implementation of a binary search tree to reinforce your understanding of tree-based data structures and search algorithms.
Browse courses on Binary Search Trees
Show steps
  • Design the interface for your binary search tree
  • Implement the insertion, search, and deletion methods
  • Test your implementation with various inputs
Review 'Algorithms, Fourth Edition'
Read and review the assigned textbook to supplement your understanding of the course material and gain deeper insights into algorithms and data structures.
View Algorithms on Amazon
Show steps
  • Obtain a copy of the textbook
  • Read assigned chapters and sections
  • Take notes or summarize key points
  • Work through practice exercises and problems
Mentor a Beginner in Java Programming
Share your knowledge and experience by mentoring a beginner in Java programming to reinforce your own understanding and develop your communication skills.
Browse courses on Java
Show steps
  • Identify a beginner who needs guidance
  • Establish a regular meeting schedule
  • Review basic Java concepts and answer questions
  • Provide hands-on coding exercises for practice

Career center

Learners who complete Algorithms, Part I will develop knowledge and skills that may be useful to these careers:
Data Scientist
Data Scientists play a vital role in modern data-driven organizations. They work with large and complex datasets to uncover insights and help businesses make informed decisions. Proficiency in algorithms and data structures is a must for Data Scientists, as they need to be able to effectively process and analyze data. The course will provide you with a solid foundation in these essential concepts.
Computer Scientist
Computer Scientists research and develop new computing technologies. They need to have a strong understanding of algorithms and data structures to develop new and innovative solutions. This course will provide you with a solid foundation in these topics, which will prepare you for a successful career as a Computer Scientist.
Artificial Intelligence Engineer
Artificial Intelligence Engineers design and develop artificial intelligence systems. They need to have a strong understanding of algorithms and data structures to develop efficient and intelligent systems. This course will provide you with the skills and knowledge you need to become a successful Artificial Intelligence Engineer.
Machine Learning Engineer
Machine Learning Engineers develop and implement machine learning algorithms to solve real-world problems. They need to have a strong understanding of algorithms and data structures to develop efficient and accurate algorithms. This course will provide you with the skills and knowledge you need to become a successful Machine Learning Engineer.
Data Engineer
Data Engineers design and build systems to store and process data. They need to have a strong understanding of algorithms and data structures to develop efficient and scalable systems. This course will provide you with the skills and knowledge you need to become a successful Data Engineer.
Software Engineer
Software Engineers translate the lofty goals of computer scientists into practical solutions. They have the skills to write the code that turns those goals into reality. In this role, you will need to use algorithms and data structures to solve complex computational problems. This course offers a comprehensive introduction to algorithms and data structures that will help you to perform your job successfully and advance in your career.
Data Analyst
Data Analysts use data to identify trends and patterns. They help businesses improve their operations and make better decisions by providing insights into the data. This course can help you become a more effective Data Analyst by providing you with strong knowledge in algorithms and data structures. These topics will enable you to efficiently organize and process large datasets, which is essential in this role.
Robotics Engineer
Robotics Engineers design and build robots. They need to have a strong understanding of algorithms and data structures to develop efficient and intelligent robots. This course will provide you with the skills and knowledge you need to become a successful Robotics Engineer.
Research Scientist
Research Scientists conduct research to advance scientific knowledge. They need to have a strong understanding of algorithms and data structures to develop new and innovative solutions. This course will help you build a foundation in these topics, which will prepare you for a successful career as a Research Scientist.
Software Developer
Software Developers are responsible for designing, implementing, testing, and maintaining software. They need to have a strong understanding of algorithms and data structures to develop high-quality, efficient software solutions. By taking this course, you will build a solid foundation in algorithms and data structures that will make you an effective and valuable Software Developer.
Web Developer
Web Developers design and develop websites. They need to have a strong understanding of algorithms and data structures to create efficient and user-friendly websites. This course will provide you with the skills and knowledge you need to become a successful Web Developer.
Game Developer
Game Developers design and develop video games. They need to have a strong understanding of algorithms and data structures to develop efficient and engaging games. This course will provide you with the skills and knowledge you need to succeed as a Game Developer.
Computer Programmer
Computer Programmers write, modify, and test code to create and maintain software. They need to have a strong understanding of algorithms and data structures to develop effective and efficient code. This course will provide you with a solid foundation in these topics, which will help you excel in your role as a Computer Programmer.
Mobile Developer
Mobile Developers design and develop applications for mobile devices. They need to have a strong understanding of algorithms and data structures to create efficient and user-friendly apps. This course will provide you with the skills and knowledge you need to succeed as a Mobile Developer.
Information Security Analyst
Information Security Analysts plan and implement security measures to protect an organization's computer networks and systems. They need to have a strong understanding of algorithms and data structures to develop effective security solutions. This course will help you build a foundation in these topics, which will help you become a more successful Information Security Analyst.

Reading list

We've selected 32 books that we think will supplement your learning. Use these to develop background knowledge, enrich your coursework, and gain a deeper understanding of the topics covered in Algorithms, Part I.
This is the primary textbook for the course, and studying this book in-depth is highly recommended. It is also the companion textbook to Algorithms, Part II, in the same course catalog.
This classic textbook provides a comprehensive introduction to algorithms and data structures, with a focus on their analysis and design.
This textbook provides a thorough treatment of data structures and algorithms in Java, with a focus on practical applications.
This series of books provides a comprehensive coverage of algorithms and data structures, with a focus on Java implementations.
Is very commonly used in undergraduate and graduate level computer science programs and is useful as a general reference text. It covers a wider range of topics than the course and provides more in-depth coverage, but its depth and breadth would be valuable in supplementing this course.
These books provide a comprehensive coverage of algorithms and data structures in C++.
Provides a rigorous treatment of algorithms and data structures, with a focus on their mathematical foundations.
Provides the theoretical underpinnings of many of the topics covered in the course and is good for reference and review.
This classic textbook provides a concise and elegant introduction to algorithms and data structures.
While not entirely focused on computer science, this mathematics text good resource for establishing a basis in the underlying mathematics of algorithms and data structures.
Good starting point or reference for learning general computer science topics, including algorithms and data structures.
Provides a comprehensive treatment of advanced data structures, with a focus on their implementation and analysis.
Is suitable for beginners or those looking to supplement the course with a less advanced text.
Provides a comprehensive treatment of graph algorithms, with a focus on their applications in various fields.
Presents practical guidance on writing elegant computer programs. While it does not directly cover the topics in the course, it may offer some insights that can enhance your programming with algorithms and data structures.
Provides a comprehensive treatment of combinatorial optimization, with a focus on its applications in various fields.
These classic books provide a comprehensive and authoritative treatment of computer algorithms and data structures.
Provides a comprehensive treatment of approximation algorithms, with a focus on their applications in various fields.
Provides a comprehensive treatment of randomized algorithms, with a focus on their applications in various fields.
Provides a comprehensive treatment of algorithmic number theory, with a focus on its applications in cryptography and other fields.

Share

Help others find this course page by sharing it with your friends and followers:

Similar courses

Here are nine courses similar to Algorithms, Part I.
Our mission

OpenCourser helps millions of learners each year. People visit us to learn workspace skills, ace their exams, and nurture their curiosity.

Our extensive catalog contains over 50,000 courses and twice as many books. Browse by search, by topic, or even by career interests. We'll match you to the right resources quickly.

Find this site helpful? Tell a friend about us.

Affiliate disclosure

We're supported by our community of learners. When you purchase or subscribe to courses and programs or purchase books, we may earn a commission from our partners.

Your purchases help us maintain our catalog and keep our servers humming without ads.

Thank you for supporting OpenCourser.

© 2016 - 2024 OpenCourser