Computer Science Principles Unit: Data Structures

अब Quizwiz के साथ अपने होमवर्क और परीक्षाओं को एस करें!

Popping.

Taking data off a stack is called ...

Static data structure so once declared they can't grow beyond their size.

Disadvantage of using a one dimensional array? (1/2)

Only use one data type.

Disadvantage of using a one dimensional array? (2/2)

More complex to program.

Disadvantage of using a three dimensional array?

They are more complex to implement.

Disadvantage of using dynamic data structures?

This can be very limiting and inefficient as you have to know in advance how large your data structure needs to be.

Disadvantage of using static data structures?

Binary trees are implemented with linked lists and pointers, stacks are implemented in an array.

Example of a complex data structure?

Stack or Queue.

Example of using static data structures?

Spreadsheets - cells are located by their sheet number, row and column.

Give an example of a three dimensional array.

Using a linked list or array and a variable that points to the top of the stack

How are stacks implemented?

By searching for the required elements and setting it's value to null.

How is data deleted from an array?

By finding an empty index and putting the data in (this involves searching).

How is new data added into an array?

A number of fields.

What does a record consist of?

The data itself and a pointer to the next node.

A linked list node contains ...

Pushing.

Adding data to a stack is called ...

They can grow to whatever size is required, size is not declared at the beginning of the program.

Advantage of using a linked list (1/2).

New items can be inserted into a linked list without rearranging all the other elements.

Advantage of using a linked list (2/2).

Easy to access and change the data inside them.

Advantage of using a one dimensional array? (1/2)

Each element can be directly referred to by its INDEX.

Advantage of using a one dimensional array? (2/2)

The best way of organising data relating to a real problem.

Advantage of using data structures?

Easy to program as you know how much space they will take up.

Advantage of using static data structures?

n-subscripts.

An n-dimensional array needs ...

More complex to program.

Disadvantage of using a linked list.

Records should be used when data types are different. For example, storing information about students in a school (Forename, Surname, Phone number and Address)

In what situation should a record be used?

Arrays should be used when data types are the same. For example, storing information about sales details for a number of objects sold over a week (all integers).

In what situation should an array be used?

Python - data can be inserted/appended.

In which language are lists dynamic?

Add item to the rear of the queue. Remove item from the front of the queue. Check if the queue is empty. Check if the queue is full.

List the four distinct operations performed on a queue.

Tail pointer = Null or -1. Start pointer = First node in the list. Free pointer = Address of next free space.

List the necessary pointers for a linked list.

Data types.

Records can use multiple ...

They are simple data structures arranged inside the other (nested).

What are complex data structures?

A good match between the structure and the task.

What does the efficiency of these operations depend on?

A data structure is a collection of related data held in a computer's memory.

What is a data structure?

They do not have a limited size, so can expand or shrink (during the program run).

What is a dynamic data structure?

An array is a collection of variables of the same data type grouped together under a single identifier.

What is a one dimensional array?

Static data structures are set at the beginning of the program and CANNOT be changed (e.g. Array or List).

What is a static data structure?

Element.

What is a variable inside an array called?

Index.

What is the elements position in the array known as?

Inserting, deleting, sorting and searching.

What operations for the elements inside do they share?

Dynamic data structure.

What type of data structure is a linked list?

First In First Out (FIFO).

What type of data structure is a queue?

Last In First Out (LIFO).

What type of data structure is a stack?

Waste of CPU cycles.

Why are memory addresses not refilled with blanks?


संबंधित स्टडी सेट्स

Chapter 20 Review: Accounting Changes and Error Corrections

View Set

Interpersonal Communications Ch. 10

View Set

Cognitive Psychology- Ch. 5 Practice Questions

View Set

Unit 9: Quiz 2: Attempts at World Peace

View Set

Foundations Exam 1 Prep U Review (pt 2)

View Set