Data Structures: Linked Lists, Stacks, Queues
Learn about singly and doubly linked lists, stacks, and queues. Understand insertion, deletion operations, and implementation in Java and pseudocode. Explore practical applications like parentheses matching.
Data Structures: Linked Lists, Stacks, Queues
E N D
Presentation Transcript
[ Section 3.1.2 ] Pseudocode Example: insertion-sort algorithm
[ Section 3.1.2 ] Pseudocode Example: insertion-sort algorithm High-level pseudocode:
[ Section 3.1.2 ] Pseudocode Example: insertion-sort algorithm More detailed pseudocode:
[ Section 3.1.2 ] Pseudocode Example: insertion-sort algorithm Java-code:
[ Section 3.1.2 ] Pseudocode • What is a pseudocode? • Why do we use it?
[ Section 3.2 ] Singly linked lists What are they?
[ Section 3.2 ] Singly linked lists Which classes and methods do we need?
[ Section 3.2 ] Singly linked lists • Inserting an element • at the beginning
[ Section 3.2 ] Singly linked lists • Inserting an element • at the end
[ Section 3.2 ] Singly linked lists Deleting an element - at the beginning
[ Section 3.2 ] Singly linked lists Deleting an element - at the end ?
[ Section 3.3 ] Doubly linked lists Picture: What classes do we need?
[ Section 3.3 ] Doubly linked lists • Insert an element • at the head • at the tail
[ Section 3.3 ] Doubly linked lists • Delete an element • the head • the tail
[ Section 3.3 ] Doubly linked lists Insert an element in the middle
[ Section 3.3 ] Doubly linked lists Delete an element in the middle
[ Section 5.1 ] Stacks Last-in-first-out (LIFO) Which methods might be useful?
[ Section 5.1 ] Stacks How to implement?
[ Section 5.1 ] Stacks The first application: matching parentheses (or tags in html)
[ Section 5.1 ] Stacks The first application: matching parentheses (or tags in html)
[ Section 5.2 ] Queues First-in-first-out (FIFO) Which methods might be useful?
[ Section 5.2 ] Queues How to implement?
[ Section 5.2 ] Queues Pseudocode for implementation via circular arrays
[ Sections 3.2-3, 5.1-2 ] Lists, Stacks, Queues A little bit about time and space requirements: Note: other variants exist: circular lists, double-ended queues, etc.