Download presentation
Presentation is loading. Please wait.
Published byCody Moore Modified over 9 years ago
1
General Data Structures and Algorithms CS 244 Brent M. Dingle, Ph.D. Department of Mathematics, Statistics, and Computer Science University of Wisconsin – Stout Based on the book: Data Structures and Algorithms in C++ (Goodrich, Tamassia, Mount) Some content from Data Structures Using C++ (D.S. Malik)
2
News! Second Test moved to April 17 unless there are any objections? This is to allow you the chance to complete the quiz PRIOR to the test day Quiz will still be due April 15
3
Previously Sorts Insertion Sort Selection Sort Bubble Sort Merge Sort Searches Linear (sequential) Search Binary Search
4
Today Look at some homework Pull some things together Give some context and reminders of how we got to the material we are now on
5
Context Reminder Most all "types" and functions in java are class types and functions. In high level concept, they are basically the same thing as C++'s Standard Template Library stuff (e.g. std::vector, std::string, std::cout,... ) Most of you started with all that stuff given to you automatic defaults of Java)
6
C and C++ not so much C has none of it (the automatic stuff) C++ by itself has very little of it. both have libraries... but we will put that aside for the moment they are not "automatically" available
7
From the Basics int i; char ch; bool boo; <-- C technically does not have bool, C++ does
8
From there you can make Arrays int A[50]; char C[50]; bool B[50];
9
From there you have Pointers int *eye_ptr; char *letter_pointer; bool *truth_pointer;
10
Pointers They can point to single values have the the memory address of a single other variable eye_ptr = &i; letter_ptr = &ch; truth_pointer = &boo;
11
Pointers (cont) Or they can point to an array a block of contiguously allocated variables by having the memory the address of the first thing in an array eye_ptr = A; or eye_ptr = & (A[0]); letter_ptr = C; or letter_ptr = & (C[0]); truth_ptr = B; or truth_ptr = &(B[0]);
12
That’s it for ‘automatic’ And that's pretty much it some details and similar types omitted/skipped That's all you get for C and C++ as far as built-in types. From there you have to make your own types. C allows this to be done using: typedef, enum, and structs and some I will skip for brevity C++ adds the option of using: class and some I will skip for brevity
13
Unit 1 Lots of C++ stuff about syntax and coding up things Focus was how to make a C++ class A couple sorting and searching things along the way Some stuff on dynamic memory allocation and deallocation A little on static and dynamic arrays A little on linked lists An intro to Big-Oh Likely some other points
14
Unit 1 – In Sum Here you saw how to use basic types how to create classes (new types) how to use arrays mostly static, but mixed with dynamic memory allocation how to make linked lists (briefly)
15
Unit 2 (so far) C++ usage continues a quick file input/ouput diversion) Lots of various on Sorting and Searching Lots on Stacks, Lists, Queues, Dequeues Emphasis: Abstract Data Type Descriptions Various ways to implement using other data types
16
Unit 2 – Progression Here we started back with definition of a linked singly linked list how to create linked lists with basic struct or class definition of an ADT stack how to implement a ADT stack with an singly linked list definition of a doubly linked list definition of an ADT queue how to implement a queue with an doubly linked list
17
Unit 2 – More Progression a dynamic array ADT a vector ADT a diversion on ADT iterators an ADT List how to implement an ADT List with a singly linked list how to implement an ADT List with a doubly linked list a diversion on ADT position
18
Unit 2 – Moving Further Along an ADT sequence how to implement an ADT sequence with an ADT array how to implement an ADT sequence with an ADT list
19
Unit 2 – Algorithms BubbleSort MergeSort Both sort of assuming ADT sequence type exists and can be used And a slight reminder of the Big-Oh stuff
20
About all of it Covers most topics Again with mention of other sorting methods and searching methods
21
The End of This Part End
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.