DATA STRUCTURE
Assignment 5 - Linked List
Problem 1. Operations on singly linked lists.
Write the following functions manipulating on linked lists:
a)
b)
c)
d)
e)
f)
g)
h)
i)
insertFirst(p, item): inserting an item into the linked list p at the beginning

1. Mark the following statements as true or false.
a. An identifier can be any sequence of digits and letters. False
b. In C+, there is no difference between a reserved word and a predefined identifier. False
c. A C+ identifier can start with a digit. Fal

Exercises Chapter 4
1. Mark the following statements as true or false:
a. The result of a logical expression cannot be assigned to an int variable. False
b. In a one-way selection, if a semicolon is placed after the expression in an if statement, the
expr

This is your Final Course Project; You will be grade based on
a.
b.
c.
d.
e.
f.
Working code without any errors
Sufficient comments for user to read your code and analyze your logic.
Proper indentation.
Proper use of variables and identifiers.
Use of Func

Final Course Project
This is your Final Course Project; You will be grade based on
a. Working code without any errors b. Sufficient comments for user to read your
code and analyze your logic. c. Proper indentation. d. Proper use of variables
and identifie

Exercises Chapter 5
1. Mark the following statements as true or false.
a. In a counter-controlled while loop, it is not necessary to initialize the loop control variable.
false
b. It is possible that the body of a while loop may not execute at all. true
c

Exercises Chapter 6
1. Mark the following statements as true or false:
a. To use a predefined function in a program, you need to know only the name of the function and how
to use it.
false
b. A value-returning function returns only one value.
true
c. Para

Exercises Chapter 1
1. Mark the following statements as true or false.
a. The first device known to carry out calculations was the Pascaline. False
b. Modern-day computers can accept spoken-word instructions but cannot imitate
human reasoning. False
c. In

DATA STRUCTURE
Assignment 1 - C Review
Problem 1. We want to get n real numbers and compute the average of the positive numbers. We
know that n is less than 1000 and some numbers are very small (< 0.01). We will resolve this problem
by three different app

DATA STRUCTURES
CS163
Instructor Informa5on
Assoc. Prof. Nguyen Thanh Binh, PhD
Email: ntbinh@dut.udn.vn
Oce: IT Faculty
TA: Doan Cong Danh
Email: danhdoan.24@gmail.com
Oce: Center of Excellence
2
Objec5ves
Underst

DATA STRUCTURE
Assignment 2 - Algorithm Analysis
Problem 1. Show that:
a. 4n2 + 7n + 1 = O(n2)
b. n2 3n + 1 = (n)
c. log(2n + k) = (log(n), where k is a constant
d.
n
log( i) O(n log( n)
i 1
Problem 2. Analyze the worst-case running time of the following

DATA STRUCTURE
Assignment 8 - Sorting
Problem 1. Sort the list 3, 1, 7, 0, 2, 1, 9, 5, 2 using
a)
b)
c)
d)
e)
Insertion Sort
Selection Sort
Bubble Sort
Quick Sort
Merge Sort
Problem 2. What is the running time of insertion sort if all elements are equal?

DATA STRUCTURE
Assignment 7 - Graphs
Problem 1. Look carefully at the definition of a graph. In one respect, graphs are more specific than
trees. What is it?
Problem 2. What is the relationship between the sum of the degrees of all vertices and the number

DATA STRUCTURE
Assignment 9 - Hashing
Problem 1. Given input cfw_4371, 1323, 6173, 4199, 4344, 9679, 1989 and a hash function h(x) = x
mod 10, show the resulting
a)
b)
c)
d)
separate chaining hash table
hash table using linear probing
hash table using qua

DATA STRUCTURE
Assignment 6 - Trees
Problem 1. Write the pre-order, in-order and post-order traversals of the binary tree shown below.
Problem 2. A binary tree has a pre-order traversal of CABDIHKMEFGJLNO and an in-order traversal of
AIDBKHMCFEJNLOG. What

DATA STRUCTURE
Assignment 3 - Array and Structures
Problem 1. Each student has three fields: name, age, sex.
a)
b)
c)
d)
Define the data structure representing a student and a list of students.
Insert a student into a sorted list so that the list is alway

DATA STRUCTURE
Assignment 4 - Stacks and Queues
Problem 1. Write the function that returns duplicate stack of the given stack. Duplicate stack
contains the same elements as the original stack, and in the same order. The original stack must stay
unchanged.