View
214
Download
0
Category
Tags:
Preview:
Citation preview
CS 202Computer Science II Lab
Fall 2009November 5
Today Topics
• Makefile• Sort Algorithms• Palindrome String
Makefilemain
main.o cylinder.o
main.cpp
cylinder.h cylinder.h
cylinder.cpp
circle.o point.o
circle.h
point.h
circle.h
circle.h
point.h
circle.cpp point.cpp
point.h
Bubble Sort
24
7
12
53
14
11
1
7
24
12
53
14
11
1
7
12
24
53
14
11
1
7
12
24
53
14
11
1
7
12
24
14
53
11
1
7
12
24
14
11
53
1
7
12
24
14
11
1
53
Selection Sort
24
7
12
53
14
11
1
6
19
23
1
7
12
53
14
11
24
6
19
23
1
6
12
53
14
11
24
7
19
23
1
6
7
53
14
11
24
12
19
23
1
6
7
11
14
53
24
12
19
23
Insertion Sort
12 10 18 20 7 40 15 23 2 17 38 32 27
current
12 12 18 20 7 40 15 23 2 17 38 32 27
temp: 10
10 12 18 20 7 40 15 23 2 17 38 32 27
current
10 12 18 20 7 40 15 23 2 17 38 32 27
current
temp: 10
Insertion Sort10 12 18 20 7 40 15 23 2 17 38 32 27
current
10 12 18 20 7 40 15 23 2 17 38 32 27
temp: 7
7 10 12 18 20 40 15 23 2 17 38 32 27
current
7 10 12 18 20 40 15 23 2 17 38 32 27
current
temp: 7
temp: 15
Insertion Sort7 10 12 18 20 40 15 23 2 17 38 32 27
temp: 15
7 10 12 15 18 20 40 23 2 17 38 32 27
current
7 10 12 15 18 20 40 23 2 17 38 32 27
temp: 23
7 10 12 15 18 20 23 40 2 17 38 32 27
current
Palindrome String
• A palindrome is a word, phrase, number or other sequence of units that has the property of reading the same in either direction. (Wikipedia)
1. K2. IMLOBOLMI3. 7345437• Create:bool ifPalindrome( char inStr[], int start, int end)
List All Palindrome
• Create a function which shows all palindrome substrings of the input string. Size of substrings are more than one.
• GBNCCNBPBNCCNBK1. CC2. BNCCNB3. BNCCNBBNCCNB4. …?
Questions?
Recommended