Write two programs using your preferred language each to implement a Linked list and a Queue. The output should look lik

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899603
Joined: Mon Aug 02, 2021 8:13 am

Write two programs using your preferred language each to implement a Linked list and a Queue. The output should look lik

Post by answerhappygod »

Write two programs using your preferred language each to
implement a Linked list and a Queue. The output should look like
the following:
--Enter your course code:
COMP2313
-- Wow! Welcome to data structures.
-- Enter your assignment number:
2
-- Ah! You will enjoy working with Linked
Lists.
-- Let's create a list and use insert and
delete.
-- Enter a number to insert into the list:
1
-- 1
-- Enter another:
3
-- 1 3
-- Enter another:
6
-- 1 3 6
-- delete a number from the tail
-- 1 3
-- delete a number from the head
-- 3
--Enter your course code:
COMP2313
-- Wow! Welcome to data structures.
-- Enter your assignment number:
2
-- Ah! You will enjoy working with Queues.
-- Let's create a list and use enqueue and
dequeue.
-- Enter a number to enqueue to the list:
1
-- 1
-- Enter another:
3
-- 1 3
-- Enter another:
6
-- 1 3 6
-- dequeue a number
-- 3 6
-- dequeue another number
-- 6
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply