BRONZE
BRONZE 등급의 판매자 자료

시간복잡도 구하는 문제 및 코드 작성 foundation of algorithmn

시간복잡도 구하는 문제 및 코드 작성 foundation of algorithmn 에 대한 문제풀이 foundation of algorithmn
10 페이지
한컴오피스
최초등록일 2010.11.15 최종저작일 2010.11
10P 미리보기
시간복잡도 구하는 문제 및 코드 작성 foundation of algorithmn
  • 미리보기

    소개

    시간복잡도 구하는 문제 및 코드 작성 foundation of algorithmn

    에 대한 문제풀이
    foundation of algorithmn

    목차

    6. Write an algorithm that finds the both the smallest and largest numbers in a list of n numbers. Try to finds a method that does at most 1.5n comparisons if array items.
    알고리즘 설명
    코드)
    실행결과)
    14. There are two algoritms calles Alg1 and Alg2 for a problem of size n, Alg1 runs in microseconds and Alg2 runs in microseconds. Alg1 can be implemented using 4 hours of programmer time and needs 2 minutes of CPU time. On the other hand, Alg2 requires 15 hours of programmer time and 6 minutes of CPU time. If programmers are paid 20 dollars per hour and CPU time costs 50 dollars per minute, how many times must a problem instance of size 500 be solved using Alg2 in order to justify its development cost?
    15. Show directly that . That is use the definitions of O and to show that is in both and .
    26. Consider the following algorithm:
    27. Consider the following algorithm:
    28. What is the time complexity T(n) of the nested loops below? For simplicity, you may assume that n is a power of 2. That is, for some positive integer k.
    29. Give an algorithm for the following problem and determine its time complexity. Given a list of n distinct positive integers, partition the list into two sublists, each of size n/2, such that the difference between the sums of the integers in the two sublists is maximized. You may assume that n is a multiple of 2.
    30. What is the time complexity T(n) if the nested loops below? For simplicity, you may assume that n is a power of 2. That is, for some positive integer k.
    35. Give an algorithm for the following problem. Given a list of n distinct positive integers, partition the list into two sublists, each of size n/2, such that the difference between the sums of the integers in the two sublists is minimized. Determine the time complexity of your algorithm. You may assume that n is a multiple of 2.

    본문내용

    알고리즘 설명
    1. n개의 숫자로 이루어진 크기n의 배열이 있으면 2개씩 짝지어서 순차적으로 대소 비교를한다.
    2.새로생성한 크기가 n인 배열에 앞부분은 비교연산결과 큰값들을 모아놓고
    뒷부분에는 연산결과 작은값 들끼리 모아놓는다.
    (뒷부분이라 함은 중간부분이 뒷부분 시작지점이다.)
    3. 앞부분의 큰값들을 모아논 부분에서는 어느게 더큰지 비교하고
    3-2 뒷부분의 작은값들을 모아논 부분에서는 어느게 작은지 비교한다.
    4. 비교된 값들을 앞쪽엔 다시 큰값들 뒤쪽엔 작은값들을 차례로 넣는다.
    5. 이과정을 반복하다보면 최종적으로 2개의 수만 남게된다.
    6. 이때 첫 번째 값이 최대값 두 번째 값이 최소값으로 각각 결정된다.
    예를들면 다음과 같이 된다.

    코드)
    ※ 크기가 유동적인 배열 대신 크기를 8로 고정하고 프로그램을 구성하였다.

    참고자료

    · 없음
  • 자료후기

    Ai 리뷰
    자료의 품질이 높고, 전문적인 내용이 많아 과제에 바로 활용할 수 있었습니다. 지식판매자에게 감사드리며, 계속해서 좋은 자료 부탁드립니다! 감사합니다.
    • 자주묻는질문의 답변을 확인해 주세요

      해피캠퍼스 FAQ 더보기

      꼭 알아주세요

      • 자료의 정보 및 내용의 진실성에 대하여 해피캠퍼스는 보증하지 않으며, 해당 정보 및 게시물 저작권과 기타 법적 책임은 자료 등록자에게 있습니다.
        자료 및 게시물 내용의 불법적 이용, 무단 전재∙배포는 금지되어 있습니다.
        저작권침해, 명예훼손 등 분쟁 요소 발견 시 고객센터의 저작권침해 신고센터를 이용해 주시기 바랍니다.
      • 해피캠퍼스는 구매자와 판매자 모두가 만족하는 서비스가 되도록 노력하고 있으며, 아래의 4가지 자료환불 조건을 꼭 확인해주시기 바랍니다.
        파일오류 중복자료 저작권 없음 설명과 실제 내용 불일치
        파일의 다운로드가 제대로 되지 않거나 파일형식에 맞는 프로그램으로 정상 작동하지 않는 경우 다른 자료와 70% 이상 내용이 일치하는 경우 (중복임을 확인할 수 있는 근거 필요함) 인터넷의 다른 사이트, 연구기관, 학교, 서적 등의 자료를 도용한 경우 자료의 설명과 실제 자료의 내용이 일치하지 않는 경우
    문서 초안을 생성해주는 EasyAI
    안녕하세요. 해피캠퍼스의 방대한 자료 중에서 선별하여 당신만의 초안을 만들어주는 EasyAI 입니다.
    저는 아래와 같이 작업을 도와드립니다.
    - 주제만 입력하면 목차부터 본문내용까지 자동 생성해 드립니다.
    - 장문의 콘텐츠를 쉽고 빠르게 작성해 드립니다.
    - 스토어에서 무료 캐시를 계정별로 1회 발급 받을 수 있습니다. 지금 바로 체험해 보세요!
    이런 주제들을 입력해 보세요.
    - 유아에게 적합한 문학작품의 기준과 특성
    - 한국인의 가치관 중에서 정신적 가치관을 이루는 것들을 문화적 문법으로 정리하고, 현대한국사회에서 일어나는 사건과 사고를 비교하여 자신의 의견으로 기술하세요
    - 작별인사 독후감
    해캠 AI 챗봇과 대화하기
    챗봇으로 간편하게 상담해보세요.
    2025년 06월 04일 수요일
    AI 챗봇
    안녕하세요. 해피캠퍼스 AI 챗봇입니다. 무엇이 궁금하신가요?
    7:00 오전