<!DOCTYPE html>
    <html lang="vi" xmlns="http://www.w3.org/1999/xhtml" prefix="og: http://ogp.me/ns#">
    <head>
<title>Tìm kiếm trong Pascal - Sách Giải</title>
<meta name="description" content="Môn học">
<meta name="keywords" content="môn học">
<meta name="news_keywords" content="môn học">
<meta name="author" content="Sách Giải">
<meta name="copyright" content="Sách Giải [sachgiai2015@gmail.com]">
<meta name="robots" content="index, archive, follow, noodp">
<meta name="googlebot" content="index,archive,follow,noodp">
<meta name="msnbot" content="all,index,follow">
<meta name="generator" content="NukeViet v4.5">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta property="og:title" content="Tìm kiếm trong Pascal">
<meta property="og:type" content="website">
<meta property="og:description" content="Môn học">
<meta property="og:site_name" content="Sách Giải">
<meta property="og:url" content="https://sachgiai.com/savefile/Tin-hoc/tim-kiem-trong-pascal-13456.html">
<link rel="shortcut icon" href="https://sachgiai.com/favicon.ico">
<link rel="canonical" href="https://sachgiai.com/savefile/Tin-hoc/tim-kiem-trong-pascal-13456.html">
<link rel="alternate" href="https://sachgiai.com/rss/" title="Môn học" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/lop-1/" title="Môn học - Lớp 1" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/ket-noi-tri-thuc/" title="Môn học - Kết nối tri thức" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/tieng-viet-1/" title="Môn học - Tiếng Việt 1" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/toan-1/" title="Môn học - Toán 1" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/giao-duc-the-chat-1/" title="Môn học - Giáo dục thể chất 1" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/my-thuat-1/" title="Môn học - Mỹ thuật 1" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/chan-troi-sang-tao/" title="Môn học - Chân trời sáng tạo" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/tieng-viet-1-ctst/" title="Môn học - Tiếng Việt 1" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/toan-1-ctst/" title="Môn học - Toán 1" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/canh-dieu/" title="Môn học - Cánh diều" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/am-nhac-1/" title="Môn học - Âm nhạc 1" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/giao-duc-the-chat-1-cd/" title="Môn học - Giáo dục thể chất 1" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/hoat-dong-trai-nghiem-1/" title="Môn học - Hoạt động trải nghiệm 1" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/toan-1-cd/" title="Môn học - Toán 1" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/tu-nhien-va-xa-hoi-1/" title="Môn học - Tự nhiên và xã hội 1" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/lop-2/" title="Môn học - Lớp 2" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/ket-noi-tri-thuc-2/" title="Môn học - Kết nối tri thức" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/toan-2/" title="Môn học - Toán 2" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/tieng-viet-2/" title="Môn học - Tiếng Việt 2" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/chan-troi-sang-tao-51/" title="Môn học - Chân trời sáng tạo" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/tieng-viet-2-ctst/" title="Môn học - Tiếng Việt 2" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/toan-2-ctst/" title="Môn học - Toán 2" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/canh-dieu-2/" title="Môn học - Cánh diều" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/toan-2-cd/" title="Môn học - Toán 2" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/tieng-viet-2-cd/" title="Môn học - Tiếng Việt 2" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/lop-3/" title="Môn học - Lớp 3" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/ket-noi-tri-thuc-3/" title="Môn học - Kết nối tri thức" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/tieng-viet-3/" title="Môn học - Tiếng Việt 3" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/toan-3/" title="Môn học - Toán 3" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/canh-dieu-3/" title="Môn học - Cánh diều" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/tieng-viet-3-cd/" title="Môn học - Tiếng Việt 3" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/toan-3-cd/" title="Môn học - Toán 3" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/chan-troi-sang-tao-3/" title="Môn học - Chân trời sáng tạo" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/tieng-viet-3-ctst/" title="Môn học - Tiếng Việt 3" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/toan-3-ctst/" title="Môn học - Toán 3" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/lop-4/" title="Môn học - Lớp 4" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/ket-noi-tri-thuc-4/" title="Môn học - Kết nối tri thức" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/tieng-viet-4/" title="Môn học - Tiếng Việt 4" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/toan-4/" title="Môn học - Toán 4" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/chan-troi-sang-tao-4/" title="Môn học - Chân trời sáng tạo" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/tieng-viet-4-ctst/" title="Môn học - Tiếng Việt 4" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/toan-4-ctst/" title="Môn học - Toán 4" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/canh-dieu-4/" title="Môn học - Cánh diều" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/tieng-viet-4-cd/" title="Môn học - Tiếng Việt 4" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/toan-4-cd/" title="Môn học - Toán 4" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/lop-5/" title="Môn học - Lớp 5" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/ket-noi-tri-thuc-5/" title="Môn học - Kết nối tri thức" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/tieng-viet-5/" title="Môn học - Tiếng Việt 5" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/toan-5/" title="Môn học - Toán 5" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/canh-dieu-5/" title="Môn học - Cánh diều" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/tieng-viet-5-cd/" title="Môn học - Tiếng Việt 5" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/toan-5-cd/" title="Môn học - Toán 5" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/chan-troi-sang-tao-5/" title="Môn học - Chân trời sáng tạo" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/tieng-viet-5-ctst/" title="Môn học - Tiếng Việt 5" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/toan-5-ctst/" title="Môn học - Toán 5" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/lop-6/" title="Môn học - Lớp 6" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/ket-noi-tri-thuc-6/" title="Môn học - Kết nối tri thức" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/ngu-van-6/" title="Môn học - Ngữ Văn 6" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/toan-6/" title="Môn học - Toán 6" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/tieng-anh-6-global-success/" title="Môn học - Tiếng Anh 6 Global Success" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/lich-su-va-dia-li-6/" title="Môn học - Lịch sử và Địa lí 6" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/giao-duc-cong-dan-6/" title="Môn học - Giáo dục công dân 6" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/tin-hoc-6/" title="Môn học - Tin học 6" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/canh-dieu-6/" title="Môn học - Cánh diều" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/giao-duc-cong-dan-6-cd/" title="Môn học - Giáo dục công dân 6" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/ngu-van-6-cd/" title="Môn học - Ngữ Văn 6" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/toan-6-cd/" title="Môn học - Toán 6" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/chan-troi-sang-tao-6/" title="Môn học - Chân trời sáng tạo" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/ngu-van-6-ctst/" title="Môn học - Ngữ Văn 6" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/toan-6-ctst/" title="Môn học - Toán 6" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/giao-duc-cong-dan-6-ctst/" title="Môn học - Giáo dục công dân 6" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/lop-7/" title="Môn học - Lớp 7" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/ket-noi-tri-thuc-7/" title="Môn học - Kết nối tri thức" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/ngu-van-7/" title="Môn học - Ngữ Văn 7" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/toan-7/" title="Môn học - Toán 7" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/tieng-anh-7-global-success/" title="Môn học - Tiếng Anh 7 Global Success" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/giao-duc-cong-dan-7/" title="Môn học - Giáo dục công dân 7" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/lich-su-va-dia-li-7/" title="Môn học - Lịch sử và Địa lí 7" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/khoa-hoc-tu-nhien-7/" title="Môn học - Khoa học tự nhiên 7" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/tin-hoc-7/" title="Môn học - Tin học 7" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/cong-nghe-7/" title="Môn học - Công nghệ 7" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/canh-dieu-7/" title="Môn học - Cánh Diều" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/ngu-van-7-cd/" title="Môn học - Ngữ Văn 7" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/toan-7-cd/" title="Môn học - Toán 7" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/khoa-hoc-tu-nhien-7-cd/" title="Môn học - Khoa học tự nhiên 7" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/chan-troi-sang-tao-7/" title="Môn học - Chân trời sáng tạo" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/ngu-van-7-ctst/" title="Môn học - Ngữ Văn 7" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/toan-7-ctst/" title="Môn học - Toán 7" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/mi-thuat-7-ctst/" title="Môn học - Mĩ thuật 7" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/am-nhac-7-ctst/" title="Môn học - Âm nhạc 7" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/lop-8/" title="Môn học - Lớp 8" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/ket-noi-tri-thuc-8/" title="Môn học - Kết nối tri thức" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/ngu-van-8/" title="Môn học - Ngữ Văn 8" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/toan-8/" title="Môn học - Toán 8" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/khoa-hoc-tu-nhien-8/" title="Môn học - Khoa học tự nhiên 8" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/giao-duc-cong-dan-8/" title="Môn học - Giáo dục công dân 8" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/tin-hoc-8/" title="Môn học - Tin học 8" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/lich-su-va-dia-li-8/" title="Môn học - Lịch sử và Địa lí 8" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/cong-nghe-8/" title="Môn học - Công nghệ 8" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/tieng-anh-8-global-success/" title="Môn học - Tiếng Anh 8 Global Success" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/canh-dieu-8/" title="Môn học - Cánh Diều" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/ngu-van-8-cd/" title="Môn học - Ngữ Văn 8" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/toan-8-cd/" title="Môn học - Toán 8" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/cong-dan-8-cd/" title="Môn học - Công Dân 8" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/chan-troi-sang-tao-8/" title="Môn học - Chân trời sáng tạo" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/ngu-van-8-ctst/" title="Môn học - Ngữ Văn 8" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/toan-8-ctst/" title="Môn học - Toán 8" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/lop-9/" title="Môn học - Lớp 9" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/ket-noi-tri-thuc-9/" title="Môn học - Kết nối tri thức" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/ngu-van-9/" title="Môn học - Ngữ Văn 9" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/toan-9/" title="Môn học - Toán 9" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/khoa-hoc-tu-nhien-9/" title="Môn học - Khoa học tự nhiên 9" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/giao-duc-cong-dan-9/" title="Môn học - Giáo dục công dân 9" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/tin-hoc-9/" title="Môn học - Tin học 9" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/lich-su-va-dia-li-9/" title="Môn học - Lịch sử và Địa lí 9" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/tieng-anh-9-global-success/" title="Môn học - Tiếng Anh 9 Global Success" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/cong-nghe-9/" title="Môn học - Công nghệ 9" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/canh-dieu-9/" title="Môn học - Cánh Diều" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/ngu-van-9-cd/" title="Môn học - Ngữ Văn 9" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/toan-9-cd/" title="Môn học - Toán 9" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/chan-troi-sang-tao-9/" title="Môn học - Chân trời sáng tạo" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/ngu-van-9-ctst/" title="Môn học - Ngữ Văn 9" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/toan-9-ctst/" title="Môn học - Toán 9" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/lop-10/" title="Môn học - Lớp 10" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/ket-noi-tri-thuc-10/" title="Môn học - Kết nối tri thức" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/ngu-van-10/" title="Môn học - Ngữ Văn 10" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/toan-10/" title="Môn học - Toán 10" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/kinh-te-va-phap-luat-10/" title="Môn học - Kinh tế và Pháp luật 10" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/tieng-anh-10-global-success/" title="Môn học - Tiếng Anh 10 Global Success" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/lich-su-10/" title="Môn học - Lịch Sử 10" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/dia-li-10/" title="Môn học - Địa Lí 10" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/vat-li-10/" title="Môn học - Vật Lí 10" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/hoa-hoc-10/" title="Môn học - Hoá học 10" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/sinh-hoc-10/" title="Môn học - Sinh học 10" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/cong-nghe-trong-trot-10/" title="Môn học - Công nghệ trồng trọt 10" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/cong-nghe-thiet-ke-10/" title="Môn học - Công nghệ thiết kế 10" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/quoc-phong-va-an-ninh-10/" title="Môn học - Quốc Phòng và An Ninh 10" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/tin-hoc-10/" title="Môn học - Tin học 10" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/canh-dieu-10/" title="Môn học - Cánh Diều" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/ngu-van-10-cd/" title="Môn học - Ngữ Văn 10" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/toan-10-cd/" title="Môn học - Toán 10" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/kinh-te-va-phap-luat-10-cd/" title="Môn học - Kinh tế và Pháp luật 10" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/tin-hoc-10-cd/" title="Môn học - Tin học 10" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/hoa-hoc-10-cd/" title="Môn học - Hoá học 10" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/lich-su-10-cd/" title="Môn học - Lịch sử 10" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/dia-li-10-cd/" title="Môn học - Địa Lí 10" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/sinh-hoc-10-cd/" title="Môn học - Sinh học 10" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/vat-li-10-cd/" title="Môn học - Vật lí 10" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/tieng-anh-10-explore-new-worlds/" title="Môn học - Tiếng Anh 10 Explore New Worlds" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/cong-nghe-trong-trot-10-cd/" title="Môn học - Công nghệ trồng trọt 10" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/cong-nghe-thiet-ke-10-cd/" title="Môn học - Công nghệ thiết kế 10" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/chan-troi-sang-tao-10/" title="Môn học - Chân trời sáng tạo" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/ngu-van-10-ctst/" title="Môn học - Ngữ Văn 10" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/toan-10-ctst/" title="Môn học - Toán 10" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/lich-su-10-ctst/" title="Môn học - Lịch Sử 10" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/dia-li-10-ctst/" title="Môn học - Địa Lí 10" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/sinh-hoc-10-ctst/" title="Môn học - Sinh học 10" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/vat-li-10-ctst/" title="Môn học - Vật Lí 10" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/hoa-hoc-10-ctst/" title="Môn học - Hoá học 10" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/quoc-phong-va-an-ninh-10-ctst/" title="Môn học - Quốc Phòng và An Ninh 10" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/kinh-te-va-phap-luat-10-ctst/" title="Môn học - Kinh tế và Pháp luật 10" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/tieng-anh-10-friends-plus/" title="Môn học - Tiếng Anh 10 Friends plus" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/lop-11/" title="Môn học - Lớp 11" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/ket-noi-tri-thuc-11/" title="Môn học - Kết nối tri thức" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/ngu-van-11/" title="Môn học - Ngữ Văn 11" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/toan-11/" title="Môn học - Toán 11" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/hoa-hoc-11/" title="Môn học - Hoá học 11" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/sinh-hoc-11/" title="Môn học - Sinh học 11" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/dia-li-11/" title="Môn học - Địa Lí 11" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/lich-su-11/" title="Môn học - Lịch Sử 11" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/vat-li-11/" title="Môn học - Vật Lí 11" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/kinh-te-va-phap-luat-11/" title="Môn học - Kinh tế và Pháp luật 11" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/cong-nghe-11-chan-nuoi/" title="Môn học - Công nghệ 11 Chăn nuôi" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/cong-nghe-11-co-khi/" title="Môn học - Công nghệ 11 Cơ khí" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/tin-hoc-11-ung-dung/" title="Môn học - Tin học 11 Ứng dụng" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/tin-hoc-11-khoa-hoc-may-tinh/" title="Môn học - Tin học 11 Khoa học máy tính" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/tieng-anh-11-global-success/" title="Môn học - Tiếng Anh 11 Global Success" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/canh-dieu-11/" title="Môn học - Cánh Diều" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/ngu-van-11-cd/" title="Môn học - Ngữ Văn 11" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/toan-11-cd/" title="Môn học - Toán 11" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/hoa-hoc-11-cd/" title="Môn học - Hoá học 11" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/lich-su-11-cd/" title="Môn học - Lịch Sử 11" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/dia-li-11-cd/" title="Môn học - Địa Lí 11" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/sinh-hoc-11-cd/" title="Môn học - Sinh học 11" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/vat-li-11-cd/" title="Môn học - Vật Lí 11" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/tin-hoc-11-ung-dung-cd/" title="Môn học - Tin học 11 Ứng dụng" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/tin-hoc-11-khoa-hoc-may-tinh-cd/" title="Môn học - Tin học 11 Khoa học máy tính" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/tieng-anh-11-explore-new-worlds/" title="Môn học - Tiếng Anh 11 Explore New Worlds" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/quoc-phong-va-an-ninh-11-cd/" title="Môn học - Quốc phòng và An ninh 11" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/kinh-te-va-phap-luat-11-cd/" title="Môn học - Kinh tế và Pháp luật 11" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/cong-nghe-11-chan-nuoi-cd/" title="Môn học - Công nghệ 11 Chăn nuôi" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/cong-nghe-11-co-khi-cd/" title="Môn học - Công nghệ 11 Cơ khí" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/chan-troi-sang-tao-11/" title="Môn học - Chân trời sáng tạo" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/ngu-van-11-ctst/" title="Môn học - Ngữ Văn 11" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/toan-11-ctst/" title="Môn học - Toán 11" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/dia-li-11-ctst/" title="Môn học - Địa Lí 11" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/hoa-hoc-11-ctst/" title="Môn học - Hoá học 11" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/sinh-hoc-11-ctst/" title="Môn học - Sinh học 11" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/lich-su-11-ctst/" title="Môn học - Lịch Sử 11" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/kinh-te-va-phap-luat-11-ctst/" title="Môn học - Kinh tế và Pháp luật 11" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/tieng-anh-11-friends-plus/" title="Môn học - Tiếng Anh 11 Friends plus" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/vat-li-11-ctst/" title="Môn học - Vật Lí 11" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/lop-12/" title="Môn học - Lớp 12" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/ket-noi-tri-thuc-12/" title="Môn học - Kết nối tri thức" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/ngu-van-12/" title="Môn học - Ngữ Văn 12" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/toan-12/" title="Môn học - Toán 12" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/dia-li-12/" title="Môn học - Địa Lí 12" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/hoa-hoc-12/" title="Môn học - Hoá học 12" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/lich-su-12/" title="Môn học - Lịch Sử 12" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/sinh-hoc-12/" title="Môn học - Sinh học 12" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/vat-li-12/" title="Môn học - Vật Lí 12" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/tieng-anh-12-global-success/" title="Môn học - Tiếng Anh 12 Global Success" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/tin-hoc-12-ung-dung/" title="Môn học - Tin học 12 Ứng dụng" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/tin-hoc-12-khoa-hoc-may-tinh/" title="Môn học - Tin học 12 Khoa học máy tính" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/kinh-te-va-phap-luat-12/" title="Môn học - Kinh tế và Pháp luật 12" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/cong-nghe-12-chan-nuoi/" title="Môn học - Công nghệ 12 Chăn nuôi" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/cong-nghe-12-co-khi/" title="Môn học - Công nghệ 12 Cơ khí" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/canh-dieu-12/" title="Môn học - Cánh Diều" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/ngu-van-12-cd/" title="Môn học - Ngữ Văn 12" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/toan-12-cd/" title="Môn học - Toán 12" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/chan-troi-sang-tao-12/" title="Môn học - Chân trời sáng tạo" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/ngu-van-12-ctst/" title="Môn học - Ngữ Văn 12" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/toan-12-ctst/" title="Môn học - Toán 12" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/Toan-hoc/" title="Môn học - Toán học" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/Van-hoc/" title="Môn học - Văn học" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/Vat-ly/" title="Môn học - Vật lý" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/Hoa-hoc/" title="Môn học - Hoá học" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/Lich-su/" title="Môn học - Lịch sử" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/Dia-ly/" title="Môn học - Địa lý" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/Anh-van/" title="Môn học - Anh văn" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/Cong-nghe/" title="Môn học - Công nghệ" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/Sinh-hoc/" title="Môn học - Sinh học" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/Tin-hoc/" title="Môn học - Tin học" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/Am-nhac/" title="Môn học - Âm nhạc" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/Mi-thuat/" title="Môn học - Mĩ thuật" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/The-duc/" title="Môn học - Thể dục" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/Cong-dan/" title="Môn học - Công dân" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/khoa-hoc/" title="Môn học - Khoa học" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/Y-khoa/" title="Môn học - Y khoa" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/Ngoai-khoa/" title="Môn học - Ngoại khoá" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/Guong-sang/" title="Môn học - Gương sáng" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/De-thi-dap-an/" title="Môn học - Đề thi, đáp án" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/Tho-van/" title="Môn học - Thơ văn" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/De-tai/" title="Môn học - Đề tài" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/Day-va-hoc/" title="Môn học - Dạy và học" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/Hoi-dap/" title="Môn học - Hỏi đáp" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/doc/" title="Môn học - Văn bản" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/tong-hop/" title="Môn học - Tổng hợp" type="application/rss+xml">
<link rel="preload" as="style" href="https://sachgiai.com/assets/css/font-awesome.min.css" type="text/css">
<link rel="preload" as="style" href="https://sachgiai.com/themes/whitebook/css/bootstrap.min.css" type="text/css">
<link rel="preload" as="style" href="https://sachgiai.com/themes/whitebook/css/style.css" type="text/css">
<link rel="preload" as="style" href="https://sachgiai.com/themes/whitebook/css/style.responsive.css" type="text/css">
<link rel="preload" as="style" href="https://sachgiai.com/themes/whitebook/css/news.css" type="text/css">
<link rel="preload" as="style" href="https://sachgiai.com/themes/whitebook/css/custom.css" type="text/css">
<link rel="preload" as="script" href="https://sachgiai.com/assets/js/jquery/jquery.min.js" type="text/javascript">
<link rel="preload" as="script" href="https://sachgiai.com/assets/js/language/vi.js" type="text/javascript">
<link rel="preload" as="script" href="https://sachgiai.com/assets/js/DOMPurify/purify3.js" type="text/javascript">
<link rel="preload" as="script" href="https://sachgiai.com/assets/js/global.js" type="text/javascript">
<link rel="preload" as="script" href="https://sachgiai.com/assets/js/site.js" type="text/javascript">
<link rel="preload" as="script" href="https://sachgiai.com/themes/whitebook/js/news.js" type="text/javascript">
<link rel="preload" as="script" href="https://sachgiai.com/themes/whitebook/js/main.js" type="text/javascript">
<link rel="preload" as="script" href="https://sachgiai.com/themes/whitebook/js/custom.js" type="text/javascript">
<link rel="preload" as="script" href="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js" type="text/javascript">
<link rel="preload" as="script" href="https://www.googletagmanager.com/gtag/js?id=G-1KVL9TDN71" type="text/javascript">
<link rel="preload" as="script" href="https://sachgiai.com/themes/whitebook/js/bootstrap.min.js" type="text/javascript">
<link rel="stylesheet" href="https://sachgiai.com/assets/css/font-awesome.min.css">
<link rel="stylesheet" href="https://sachgiai.com/themes/whitebook/css/bootstrap.min.css">
<link rel="stylesheet" href="https://sachgiai.com/themes/whitebook/css/style.css">
<link rel="stylesheet" href="https://sachgiai.com/themes/whitebook/css/style.responsive.css">
<link rel="StyleSheet" href="https://sachgiai.com/themes/whitebook/css/news.css">
<link rel="stylesheet" href="https://sachgiai.com/themes/whitebook/css/custom.css">
<style>
	body{background: #fff;}
</style>
<!-- Google Tag Manager -->
<!-- End Google Tag Manager -->
</head>
    <body>
<!-- Google Tag Manager (noscript) -->
<noscript><iframe src="https://www.googletagmanager.com/ns.html?id=GTM-PMHW5CD"
height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
<!-- End Google Tag Manager (noscript) -->
<div id="print">
	<div id="hd_print">
		<h2 class="pull-left">Sách Giải</h2>
		<p class="pull-right"><a title="Sách Giải" href="https://sachgiai.com/">https://sachgiai.com</a></p>
	</div>
	<div class="clear"></div>
	<hr />
	<div id="content">
		<h1>Tìm kiếm trong Pascal</h1>
		<ul class="list-inline">
			<li>Thứ tư - 05/08/2020 09:34</li>
			<li class="hidden-print txtrequired"><em class="fa fa-print">&nbsp;</em><a title="In ra" href="javascript:;" onclick="window.print()">In ra</a></li>
			<li class="hidden-print txtrequired"><em class="fa fa-power-off">&nbsp;</em><a title="Đóng cửa sổ này" href="javascript:;" onclick="window.close()">Đóng cửa sổ này</a></li>
		</ul>
		<div class="clear"></div>
		<div id="hometext">
			1. TỐNG QUÁTMột trong các nhiệm vụ cơ bản của máy tính là tìm kiếm. Từ một cơ sở dữ liệu cho trước và một đối tượng cho trước ta phải trả lời hai câu hỏi:- Đối tượng có mặt trong cơ sở dữ liệu đó hay không ?- Nếu có thì cho biết vị trí của nó.
		</div>
		<div id="bodytext" class="clearfix">
			<div style="text-align: justify;"><span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">Để đơn giản hóa vấn đề ở đây chúng ta chỉ giới hạn vấn đề trong việc tìm một giá trị X (nguyên) xem có nằm trong một dãy các số nguyên hay không ?</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">Phương pháp tổng quát là đi so sánh X với các phần tử của dãy, nếu việc so sánh cho kết quả TRUE thì việc tìm kiếm thành công.</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">Có nhiều thuật toán để tìm kiếm, ỏ đây chúng ta chỉ xét 2 thuật toán cơ bản đó là:</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">- Tìm tuần tự (Sequential Search).</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">- Tìm nhị phân (Binary Search).</span></span></span><br />
<br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif"><b>2. TÌM KIẾM TUẦN TỰ&nbsp;TRÊN MỘT DÃY CHƯA CÓ THỨ TỰ</b></span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif"><b><i>a) Thuật toán</i></b></span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">- So sánh từng phần tử của dãy A&#91;1..n&#93; với giá trị x.</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">- Trong khi đi từ phần tử đầu đến phần tử cuối của dãy:</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">+ Nếu tìm thấy giá trị x thì thoát ra và thông báo thứ tự của thành phần thứ i thỏa A&#91;i&#93; = x.</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">+ Nếu sau khi đi hết mà không tìm thấy thì việc tìm kiếm xem như kết thúc với kết quả là 0.</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif"><b><i>b) Lập trình Pascal</i></b></span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">Function Tim (x: integer; A: Array&#91;1..n&#93; of integer);Word; Var i : word;</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">Begin</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">&nbsp;&nbsp;&nbsp;&nbsp; i:= 1;</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">&nbsp;&nbsp;&nbsp;&nbsp; While (i &lt;= n) and not (x = A&#91;i&#93;) do</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; inc (i);</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; If i &gt; n then Tim := 0</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Else Tim:= i;</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">End.</span></span></span><br />
<br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif"><b>3. TÌM KIÊM TUẦN TỰ&nbsp;TRÊN MỘT DÃY ĐÃ CÓ THỨ TỰ</b></span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif"><b><i>a) Thuật toán</i></b></span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">- Thuật toán tìm tuần tự trong trường hợp xấu nhất là tìm không thấy do đó sẽ thực hiện n lần so sánh.</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">- Giả sử dãy A đã được sắp thứ tự tăng dần ta có thể cải tiến lại thuật toán trên để chạy nhanh hơn như sau:</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">+ Bắt đầu từ i = 1.</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">+ Trong khi (i &lt;= n) và (A&#91;i&#93; &lt; x) tăng i.</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">+ Nếu (i &lt; n và A&#91;i&#93; &gt; x) hay (i &gt; n) thì:</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">• Không tìm thấy.</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">Ngược lại thì:</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">• Giá trị cần tìm ở thành phần thứ i.</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif"><b><i>b) Lập trình Pascal</i></b></span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">Function Tim (x: integer; A: Array&#91;1..n&#93; of Integer): word;</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">Var i: word;</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">Begin</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">&nbsp;&nbsp;&nbsp;&nbsp; i:= 1;</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; While (i &lt;= n) and (x &gt; A&#91;iJ) do</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Inc (i);</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; If ((i &lt;= n) and (A&#91;i&#93; &gt; x)) or (i &gt; n) then</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Tim:= 0</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Else</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Tim:= i;</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">End;</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif"><b><i><u>• Chú ý:</u></i></b></span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">Nếu dãy được sắp xếp theo thứ tự giảm dần thì ta phải đảo điều kiện trong các biểu thức điều kiện như sau:</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">While (i &lt;= n) and. (x &lt; A&#91;i&#93;)</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">If ((i &lt;= n) and (A&#91;i&#93; &lt; x)) or (i &gt; n).</span></span></span><br />
<br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif"><b>4. TÌM KIẾM TUẦN TỰ VỚI LÍNH CANH</b></span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif"><b><i>a) Thuật toán</i></b></span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">- Dùng một lính canh cụ thể là phần tử A&#91;n + 1&#93; có thể đơn giản hóa quá trình tự kiếm tuần tự.</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">- Trước khi tìm kiếm phần tử có giá trị bằng X trong đoạn dãy A&#91;1..n&#93; ta đặt giá trị đó tại trạm canh bằng lệnh gán:</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; a&#91;n + 1&#93;:= X;</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">- Nhờ có lính canh nên câu lệnh lặp:</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">REPEAT</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">&nbsp;&nbsp;&nbsp;&nbsp; i:= i + 1</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">UNTIL</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">A&#91;i&#93; := x;</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">luôn luôn được kết thúc một cách tự nhiên, bởi vì trong trường hợp tìm được ta sẽ có A&#91;i&#93; = x với (1 &lt; i &lt; n), còn trong trường hợp giá trị x không có mặt trong mảng A&#91;1..n&#93; thì ta vẫn có:</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">A&#91;i&#93; := x với i = t + 1</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">- Việc dùng lính canh đòi hỏi mảng a phải chứa ít ra là n + 1 phần tử.</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif"><b><i>b) Lập trình Pascal</i></b></span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">A&#91;n + 1&#93;:= x; {Đặt lính canh}</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">I := 0;</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">Repeat</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">&nbsp;&nbsp;&nbsp; I := i + 1;</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">Until A&#91;i&#93;:= x;</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">If i &lt;= n then writeln(i)</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">else Writein (&#039;không tìm được&#039;);</span></span></span><br />
<br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif"><b>5. TÌM KIẾM NHỊ PHÂN TRÊN MỘT MẢNG ĐƯỢC SẮP</b></span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif"><b><i>a) Thuật toán</i></b></span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">- Giả sử mảng A&#91;1..n&#93; đã được sắp thứ tự tăng dần.</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">- Ta chia đôi mảng A xem thành phần ở giữa có giá trị lớn hơn hay nhỏ hơn giá trị x để từ đó xác định nên tiếp tục tìm kiếm trên dãy trên hay dãy dưới. Giả sử chọn được dãy trên, tiếp tục chia đôi dãy trên để tìm kiếm cho đến khi gặp hoặc không thể chia đôi được nữa (nghĩa là không tìm thấy).</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">Ta dùng 3 biến Low, High, Mid để lưu giữ chỉ số của đầu, cuối, giữa của dãy đang tìm kiếm.</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">- Ban đầu cho Low:= 1; High:= n.</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">- Chừng nào High &gt; Low thì thực hiện:</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">• Mid + (Low + Ligh) Div 2</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">• Nếu x &gt; A&#91;Mid&#93; thì</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">&nbsp; Low:= Mid + 1</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">&nbsp; Ngược lại (x &lt;= A&#91;Mid&#93;</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">• Nếu x &lt; A&#91;Mid&#93; thì</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">&nbsp; High:= Mid - 1</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">&nbsp; Ngược lại (a = A&#91;Mid&#93;)</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">&nbsp; High:= -1</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">• Nếu High = -1 thì đã tìm thấy x tại thành phần thứ Mid.</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">Ngược lại không tìm thấy.</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif"><b><i>b) Lập trình Pascal</i></b></span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">Function Tim (x: integer; A: Array&#91;1..n&#93; of integer): word;</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">Var</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">Low, High, Mid: integer;</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">Begin</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">&nbsp;&nbsp;&nbsp; Low:= 1; High:= n;</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">&nbsp;&nbsp;&nbsp; While High &gt;= Low do</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">Begin</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">&nbsp;&nbsp;&nbsp;&nbsp; Mid:= (High + Low) div 2;</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">&nbsp;&nbsp;&nbsp;&nbsp; If (A&#91;Mid&#93; &lt; x) then</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Low := Mid + 1</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">&nbsp;&nbsp;&nbsp;&nbsp; else</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; If (x &lt; x&#91;Mid&#93; then</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; High := Mid - 1</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;Else</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; High:= -1</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;end;</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">&nbsp; If high = -1 then Tim:= Mid; else Tim:= 0</span></span></span></div>
		</div>
				<div class="copyright">
			Bản quyền bài viết thuộc về <a href="https://sachgiai.com">Sachgiai.com</a>. Ghi nguồn Sách giải.com khi đăng lại bài viết này.
		</div>
	</div>
	<div id="footer" class="clearfix">
		<div id="url">
			<strong>URL của bản tin này: </strong><a href="https://sachgiai.com/savefile/Tin-hoc/tim-kiem-trong-pascal-13456.html" title="Tìm kiếm trong Pascal">https://sachgiai.com/savefile/Tin-hoc/tim-kiem-trong-pascal-13456.html</a>

		</div>
		<div class="clear"></div>
		<div class="copyright">
			&copy; Sách Giải
		</div>
		<div id="contact">
			<a href="mailto:sachgiai2015@gmail.com">sachgiai2015@gmail.com</a>
		</div>
	</div>
</div>
        <div id="timeoutsess" class="chromeframe">
            Bạn đã không sử dụng Site, <a onclick="timeoutsesscancel();" href="https://sachgiai.com/#">Bấm vào đây để duy trì trạng thái đăng nhập</a>. Thời gian chờ: <span id="secField"> 60 </span> giây
        </div>
        <div id="openidResult" class="nv-alert" style="display:none"></div>
        <div id="openidBt" data-result="" data-redirect=""></div>
<script src="https://sachgiai.com/assets/js/jquery/jquery.min.js"></script>
<script>var nv_base_siteurl="/",nv_lang_data="vi",nv_lang_interface="vi",nv_name_variable="nv",nv_fc_variable="op",nv_lang_variable="language",nv_module_name="news",nv_func_name="savefile",nv_is_user=0, nv_my_ofs=-4,nv_my_abbr="EDT",nv_cookie_prefix="nv3c_Fsp0c",nv_check_pass_mstime=3538000,nv_area_admin=0,nv_safemode=0,theme_responsive=1,nv_recaptcha_ver=2,nv_recaptcha_sitekey="6LfJY60ZAAAAAIWdlphAn4Y3Vz9PjefcOrgz8WDV",nv_recaptcha_type="image",XSSsanitize=1;</script>
<script src="https://sachgiai.com/assets/js/language/vi.js"></script>
<script src="https://sachgiai.com/assets/js/DOMPurify/purify3.js"></script>
<script src="https://sachgiai.com/assets/js/global.js"></script>
<script src="https://sachgiai.com/assets/js/site.js"></script>
<script src="https://sachgiai.com/themes/whitebook/js/news.js"></script>
<script src="https://sachgiai.com/themes/whitebook/js/main.js"></script>
<script src="https://sachgiai.com/themes/whitebook/js/custom.js"></script>
<script type="application/ld+json">
        {
            "@context": "https://schema.org",
            "@type": "Organization",
            "url": "https://sachgiai.com",
            "logo": "https://sachgiai.com/uploads/sach-giai-com-logo.png"
        }
        </script>
<script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<script>
			 (adsbygoogle = window.adsbygoogle || []).push({
				  google_ad_client: "ca-pub-7282572069040310",
				  enable_page_level_ads: true
			 });
        </script>
<script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
})(window,document,'script','dataLayer','GTM-PMHW5CD');</script>
<script async src="https://www.googletagmanager.com/gtag/js?id=G-1KVL9TDN71"></script>
<script>window.dataLayer=window.dataLayer||[];function gtag(){dataLayer.push(arguments)}gtag('js',new Date);gtag('config','G-1KVL9TDN71');</script>
<script src="https://sachgiai.com/themes/whitebook/js/bootstrap.min.js"></script>
</body>
</html>