Professional Documents
Culture Documents
HCT108 Research Questions 1
HCT108 Research Questions 1
3. With the aid of relevant examples discuss the following hypothesis about
data structures “the structure of the data affects what can be done
efficiently with the data”
4. The data structure philosophy states that “Each data structure has costs
and benefits that rarely is one data structure better than another in all
situations”. With the aid of relevant examples and comparing different
data structures support or refute the above philosophy.
5. Write a C++ program that shows all the basic array operations such as
searching, insertion, deletion, retrieval, traversal etc. on a one and two
dimensional array.
6. Write a program in C++ to create two arrays to store Reg numbers and
marks for students whose total number would be known at runtime
11. Given a list of objects stored in a sorted linked list, describe an algorithm
to insert a new object as efficiently as possible while keeping the list
sorted. You may describe your algorithm in English, pseudocode, and/or
C++ code, as long as your description is clear
12. Discuss the array representation of stacks showing the push and pop
stack operations
13. Taking a queue containing numbers 10, 15, 5, 25 and 30 in which 30 has
been inserted first. After performing the following operations what will
be the contents of the queue? (a) delete two elements (b) insert 7 and
then 20 (c) delete an element? With the aid of diagrams where necessary
show how you arrive at your answer.
14. Research on basic linked listed applications and Write a C++ program that
shows the Implementations of Lists Using Arrays.
15. Write a C++ program that shows the array implementation of a stack
showing all the basic stack operations in the main of that program.
16. Research on how to change expressions from infix to postfix using the
stack implementation
17. Convert the following infix to postfix using the stack implementation and
solve the postfix expression also using the stack implementation
(a + b) / (c –d) * (e + f)
((a – b) * (c + d)) / (e + f) * (g + h)
Where a= 7, b = 4, c=10, d=20, e= 11, f=5, g=2, h =3
18. Change the following infix expression to a postfix expression using the
addition of parentheses ( ).
(i) ((a+b)/d-((e-f)+g)
(ii) 12/3*6+6-6+8/2
19. Change the following infix expression to a prefix expression using the
addition of parentheses ( ).
(i) ((a+b)/d-((e-f)+g)
(ii) 12/3*6+6-6+8/2 12
21. Discuss in detail where it will be best to apply the following data
structures: binary search trees, queues, sorted linked lists, sorted arrays,
and a hash table using open addressing
22. Research on Binary Search Trees (BST) focusing mainly on how to create
them, search them, insert nodes into them, traverse them, delete nodes
from them and lastly their basic applications
23. Form the binary tree for which the following are given:
Inorder traversal: f h i g b a d e c
Preorder traversal: a b f g h i c d e
24. The following is a binary tree:
14
/ \
2 11
/ \ / \
1 3 10 30
/ /
7 40
26.
27. Insert the following numbers into a binary search tree in the order that
they are given and draw the resulting tree. 14; 34; 22; 44; 11; 24; 33; 90
31. Research on the following sorting techniques, discussing their pros and
cons and where best they can be applied: merge sort, bubble sort, quick
sort, simple selection sort and linear insertion sort. Lastly look into how
they can all be implemented using arrays.
32. Write an algorithm for quick sort. Also apply the algorithm to the
following sequence: 25, 10, 30, 15, 20, 28, 18, and 12 showing all the
intermediatory steps.
33. Sort the following list using the merge sort : 8,2,4,6,9,7,10,1,5,3
34.Show the steps of bubble and shell sort algorithm on the following list of
unsorted integers. 21; 75; 29; 2; 15; 23; 221; 7; 88; 195
35. Why is quick sort named as “quick”? Show how the following data set
can be sorted by quick sort: 78, 23, 11, 88, 43, 55, 67 and 55 showing each
step in sorting.
36. An array contains these elements: 13, 17, 97, 44, 8, 56, 26, 88
a. Use quick sort to show the steps needed to sort the array
b. On the sorted array use the binary search algorithm to trace the
steps followed to find the element 88
c. How many number of steps do you need to search the above array
using the binary search algorithm
38. Show the steps of quick sort algorithm on the following list of
unsorted integers. Assume that the pivot node is always the one on the
left hand side of the list. Box all pivots and underline all numbers that
have been placed in their correct respective positions.
E; X; A; M; P; L; E; S; I
39. Computer science department want to come up with an
innovation hub. Students in level 2 who develop good projects are
rewarded by having their projects showcased in the hub. The projects are
done in teams not exceeding 4. Marks awarded by the panel of lecturers
are used to determine the top 3 projects and are awarded $5000, $3000
and $1000 price money respectively. Using an appropriate data type
implement a program to come up with 3 best projects from 10 done by
the level 2 student. You can make any of your assumption but the
program should be able to print the three best projects and the team
members.