What is the difference between arrays and lists

Assignment Help Computer Engineering
Reference no: EM132138057

Subject : Computer Algorithms

Book: Introduction to Algorithms 3rd edition

1)

a) Using Figure 10.1 as a model, illustrate the result of each operation in the sequence PUSH(S,6), PUSH(S,2), PUSH(S,8), POP(S), PUSH(S,5), PUSH(S,3), POP(S), POP(S), and PUSH(S,1), on an initially empty stack S stored in array S[1..6].

b) Using Figure 10.2 as a model, illustrate the result of each operation in the sequence ENQUEUE(Q,6), ENQUEUE(Q,2), ENQUEUE(Q,8), DEQUEUE(Q), ENQUEUE(Q,5), ENQUEUE(Q,3), DEQUEUE(Q), DEQUEUE(Q), and ENQUEUE(Q,1), on an initially empty queue Q stored in array Q[1..6].

2)

a) What is the difference between arrays and lists?

b) What are the pros and cons of storing data in arrays and/or lists?

c) You are given 7 Giga Bytes worth of data that must be loaded in memory in a computer with 8GB of RAM. Which data structure would use: an array or a list? Why?

d) You are given 1 Giga Byte worth of data that must be loaded in memory in a computer with 8GB of RAM and to be used mainly by a binary-search algorithm. Which data structure would use: an array or a list? Why?

e) You are given 1 Giga Byte worth of data that must be loaded in memory in a computer with 8GB of RAM and to be used mainly by a membership keeper algorithm from a nationwide gym. Which data structure would use: an array or a list? Why?

3) Demonstrate what happens when we insert the keys {7,8,29,14,10,31,0,13,12,17,18,20} into a hash table with collisions resolved by chaining. Let the table have 9 slots, and let the hash function be h(k)=k mod 9.

Reference no: EM132138057

Questions Cloud

Three things that differentiate parametric : Let's see how much you have been paying attention. For your first Pause-Problem in this chapter, please tell me three things that differentiate parametric
What is the probability that a randomly selected television : What is the probability that a randomly selected television from the site sells for between ?$400 and ?$500?
Explain why this is a binomial experiment : According to an? airline, flights on a certain route are on time 80% of the time. Suppose 13 flights are randomly selected and the number of? flights is recorde
Create and print the detention code of each class : Create classes, methods, and design icons for their mobile device application using OOP language and GUI. The following must be included.
What is the difference between arrays and lists : What is the difference between arrays and lists? What are the pros and cons of storing data in arrays and/or lists?
What is the probability that a randomly selected car : What is the probability that a randomly selected car is violating the speed limit of 50 miles per hour?
What is the probability that 6 home runs : In a single? season, an average of 2.4 home runs were hit per game. Assume the number of home runs per game follows the Poisson distribution.
Simulate the stuck in the mud game with additional features : Write a MATLAB program to simulate the Stuck in the Mud game with additional features.
Find the probability that the number is more than 8 : Find the probability that the number is more than 8 (second answer listed below).

Reviews

Write a Review

Computer Engineering Questions & Answers

  How do you now combine the field to get back original output

How do you display the date output with each field on a separate line? How do you now combine the fields to get back the original output?

  Estimate the average mass-transfer rate per unit

It is required to estimate the average mass-transfer rate per unit area of benzene evaporating from the outer surface of a circular cylinder across.

  Computer graphics make a comparison between vector graphics

make a comparison between vector graphics and raster graphics display system and justify your

  Questionwrite down program that computes the cost of a long

questionwrite down program that computes the cost of a long distance call. the cost of call is determined according to

  Design a powerpoint presentation based on the scenario

design a PowerPoint presentation based on the scenario. You have been asked to present tips on time management skills to new students at an online university. Your group will work together to organize and create a presentation with your advice.

  How given components affect the critical success factors

The ultimate success of a project is the responsibility of the project manager. Information technology (IT) projects are often focused on technical issues.

  Which nodes are in the subtree rooted at node projects

How many ancestors does node cs016/ have? What are the siblings of node homeworks/? Which nodes are in the subtree rooted at node projects/?

  Display the account in a listbox

Create an application that list accounts from a Dictionary Object - Display the account in a ListBox. If the user enters new values, they can click on the Add Button to add a new account to the dictionary item.

  Explain why to implement a queue using a linked list

Explain why, to implement a queue using a linked list, it is recommended to extract nodes from the top of the list and insert nodes at the tail of the list.

  How the next-state samples are generated

Present the algorithm clearly and mathematically, specifying exactly how the weights are computed and how the next-state samples are generated.

  Describe the difference between dhtml and html

explain examples of JavaScript script usage in a commercial setting.

  Problem based on undirected graph

Let T be the unique MST of a given undirected graph G = (V, E) with distinct weights w (u, v) on edges (u, v). Explain why T' has a higher cost than T.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd