Skip to content

hsiehkl/Data-Structure-and-Programming

Repository files navigation

Data-Structure-and-Programming

NTU 107-01 Data Structure and Programming

Course Information:Syllabus

HW1: Stack

Problem 1: Implement the following functions of the stack.

push(): Put the data in the top of the stack.
pop(): Delete the data in the top of the stack.
top(): View the data in the top of the stack.

Problem 2: Largest Rectangular Area of Buildings

Today, school wants to make a huge advertising banner. Thus, we need to find out the largest rectangular area of buildings. The height of banner should not exceed any of buildings.

HW2: Dynamic Programming

This programming assignment asks you to compute how many ways a string composed of digits can be divided into integers (“n1, n2, ..., nk”) ranging from 0 to 100 (0 ≤ ni ≤ 100, i = 1, 2, ..., k). For example, the digit string “21005” can be divided into “2,1,0,0,5”, “21,0,0,5”, “2,10,0,5”, or “2,100,5”, and thus there are 4 ways to divide the string. Note that 0-leading numbers (except for 0 itself) are not allowed. For example, “2,10,05” is not allowed due to the leading zero in “05”.

HW3: Binary Search Tree (BST)

This programming assignment asks you to check if a given sequence can be a preorder or a postorder traversal of a BST. If yes, please find the another way to traverse the corresponding BST.

HW4: Priority Queue

This programming assignment asks you to implement a priority queue by a binary heap. The input contains three commands as follows (Note that when findMin is performed, you should store the returned value.):

insert x: insert the number x into the heap.
deleteMin: delete the minimum key from the heap. 
findMin: find the minimum key in the heap.

HW5: Sorting

Given a number K and a set of integer values, what is the minimum difference between the maximum and the minimum of all possible K-element subsets?

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages