[Solved] ITDSIU19023 Lab 5

$25

File Name: ITDSIU19023_Lab_5.zip
File Size: 160.14 KB

SKU: [Solved] ITDSIU19023 Lab 5 Category: Tag:
5/5 - (1 vote)

Create one single .c file and use functions for the questions (e.g. ex01, ex02, for the function names)

  1. Input a string, find the length of the longest substring without repeating characters.

Examples:

abcabcbb, the answer is abc, length = 3

bbbbb, the answer is b, length = 1

  1. Input an array of integers, return indices of the two numbers such that they add up to a specific target. You may not use the same element twice.

input nums = [2, 7, 11, 15], target = 9 return [0,1]

  1. Median of a sorted array:
  • If the number of values is odd, the median is the middle value
  • If the number of values is even, the median is the average of the two middle values

Find the median of the two sorted arrays (optional: your solution should be O(log(m+n)), m n is size of two arrays)

Example:

array 1 = [1,2,5] array2 = [3,4,7,9] => [1,2,3,4,5,7,9] => median is 4

array 1 = [1,2,5,8] array2 = [3,4,7,9] => [1,2,3,4,5,7,8,9] => median is (4+5)/2 = 4.5

  1. (optional) Given an integer, convert it to a roman number.

Input must be within the range from 1 to 3999.

Reviews

There are no reviews yet.

Only logged in customers who have purchased this product may leave a review.

Shopping Cart
[Solved] ITDSIU19023 Lab 5[Solved] ITDSIU19023 Lab 5
$25