1
00:00:01,010 --> 00:00:04,070
All right, so this is going to be a short lecture.

2
00:00:04,940 --> 00:00:08,480
It's not really much of a lecture, it's another one of those challenges for you.

3
00:00:09,260 --> 00:00:11,930
And this is going to be a searching challenge.

4
00:00:11,940 --> 00:00:16,670
So we just went over sorting and now we are going to go over something called searching.

5
00:00:18,830 --> 00:00:27,200
So what I would like you to do is to make a function and a program, of course, but make a function

6
00:00:27,200 --> 00:00:31,550
that takes an array or a vector and an integer as an argument.

7
00:00:31,580 --> 00:00:38,870
So there must be arguments they should both be parameters, then that function should return a Boolean

8
00:00:38,870 --> 00:00:44,330
value based on whether the integer is in the array or vector or not.

9
00:00:45,020 --> 00:00:51,230
So there's that second argument is going to be a number and you want to see if that number exists inside

10
00:00:51,230 --> 00:00:52,420
the vectors array.

11
00:00:53,690 --> 00:00:58,340
So this function should be part of an overall program that lets the user enter five integers to get

12
00:00:58,340 --> 00:01:00,440
read into that array or vectors.

13
00:01:00,440 --> 00:01:02,840
So similar to like what we did with the sorting.

14
00:01:03,620 --> 00:01:10,460
And then it should ask for two more integers that get added up to a sum that then gives sent to that

15
00:01:10,460 --> 00:01:13,130
function as that number that you need to search for.

16
00:01:13,850 --> 00:01:15,620
So hopefully, that's pretty straightforward.

17
00:01:16,250 --> 00:01:18,020
You can see some examples here.

18
00:01:18,140 --> 00:01:23,750
So these are all the numbers that would be read into that vector or array.

19
00:01:24,470 --> 00:01:30,560
And then here are the two numbers that the user enters and they added together.

20
00:01:30,570 --> 00:01:36,910
So this example seven percent and 14, you know, same message prints out message prints out down there.

21
00:01:36,920 --> 00:01:38,390
The buttons has seven plus seven equals.

22
00:01:38,390 --> 00:01:41,660
14 is not in the list because you notice that there is No.

23
00:01:41,660 --> 00:01:42,350
14 here.

24
00:01:43,250 --> 00:01:47,870
This one right here, though, the user interest at three and two for the numbers, and it's the same

25
00:01:47,870 --> 00:01:49,850
set of numbers in that vector.

26
00:01:50,840 --> 00:01:53,720
It says that three plus two equals five.

27
00:01:54,440 --> 00:01:56,450
Five is right here in the list.

28
00:01:56,450 --> 00:01:59,420
So if this is in the list and so this is what should print out.

29
00:02:00,560 --> 00:02:06,920
So this one, I think, is a little easier than the sorting, but still a good exercise.

30
00:02:07,280 --> 00:02:11,270
So I won't go ahead and leave you to it here.

31
00:02:11,270 --> 00:02:19,190
And then in the next video, I will go over a solution to a very basic searching algorithm.

32
00:02:19,670 --> 00:02:23,960
The most primitive searching algorithm, kind of like how I started off a bubble saw it as the most

33
00:02:23,960 --> 00:02:24,740
primitive sort.

34
00:02:25,220 --> 00:02:29,300
Now we're going to talk about the most primitive searching algorithm, but you can come up with any

35
00:02:29,300 --> 00:02:31,220
type of search you would like for this.

36
00:02:31,700 --> 00:02:37,100
But the point is just to solve the problem right now, so it prints out the correct answer.

37
00:02:37,880 --> 00:02:39,790
All right, so without seeing the next lecture?
