Question: Question 1 A data structure is a specialized format for organizing and storing data. General data structure types include the array, the file, the record,

 Question 1 A data structure is a specialized format for organizing

Question 1 A data structure is a specialized format for organizing and storing data. General data structure types include the array, the file, the record, the table, the tree, and so on. Any data structure is designed to organize data to suit a specific purpose so that it can be accessed and worked with in appropriate ways. (a) Determine whether each of the following characteristics apply to a stack, a queue, both, or none. i. An element is inserted at a special place called the top. (1 mark) ii. An element is inserted at a special place called the rear. (1 mark) iii. The structure can hold only one type of data element. (1 mark) iv. An element is deleted at the front. (1 mark) v. The ith position may be deleted. (1 mark) vi. An element is deleted at the top. (1 mark) vii. The structure is a LIFO structure. (1 mark) viii. The structure is a FIFO structure. (1 mark) ix. The structure is a restricted access structure. (1 mark) (b) What is the advantages of using linked list compared to array? (2 marks) (c) Briefly explain FIVE (5) basic operations of linked list. (5 marks) (d) Given the following structure definition to be implemented using a stack: struct functionCalled string functionName; struct functionCalled *next; }; Write C++ statements to perform the task below: i. To insert a new node into the stack. Assume that the new node is already created and pointed by a pointer called newNode. (4 marks) ii. To delete a node from the stack. (5 marks) 25 Marki

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!