Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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,

image text in transcribed

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions

Question

How do traditional mental models play into the process of change?

Answered: 1 week ago

Question

Which personal relationships influenced you the most?

Answered: 1 week ago