1.4. Data types data structures and algorithms

0.0(0)
studied byStudied by 1 person
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
Card Sorting

1/39

encourage image

There's no tags or description

Looks like no tags are added yet.

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced

No study sessions yet.

40 Terms

1
New cards

primitive data types

set of basic data types from which all other data types are constructed

2
New cards

arrays

ordered finite set of element of a single type

3
New cards

arrays are static - meaning ?

static means that the size is determined when the array is acollated

4
New cards

what is a record ?

a row in a file

5
New cards

difference between a list and an array

values are stored non-contiguously

elements can be different data types

6
New cards

non-contiguous

doesn’t have to be stored next to one another in memory

7
New cards

isEmpty()

checks if the list is empty

8
New cards

append(val)

adds a new value to the list

9
New cards

remove(val)

removes the value the first occurrence in the list

10
New cards

search(val)

searches for a value in a list

11
New cards

len()

returns the length of list

12
New cards

index(val)

return the position of input val in a list

13
New cards

insert(position,val)

insert value at given position in a list

14
New cards

pop()

removes last value of the list

15
New cards

pop(index)

removes value at given postion in a list

16
New cards

list

data structure consisting of orders items where the values are stored non-contiguously

17
New cards

what is an abstract data type?

object created by the programmer, defined by a set of values and set of operations.

18
New cards

what is a static data type ?

data type defined when the data is given and is fixed as the same type for the lifetime of the program

19
New cards

tuples

static, immutable, ordered, stores more than one data type, contiguous

20
New cards

linked list

a dynamic data structure that holds an ordered sequence. each node has a value and a pointer to the next node.

21
New cards

graph

set of vertices connected by edges

22
New cards

directed graph

edges can be traversed in only one direction

23
New cards

undirected graphs

the edges can be traversed in both direction

24
New cards

weighted graphs

a cost is attached to each edge

25
New cards

what is a queue?

FIFO data structure enQueue at rear, deQueue at front.

26
New cards

applications of queue

keyboard buffer, first come first serve printer, stimulation programs

27
New cards

what is a doubly linked list

extra node that points at the previous node

28
New cards

how are queues implemented ?

using arrays or objects

29
New cards

issue with implementing queue with array ?

the array has a fixed size, if the array is filled nothing can be added to the queue.

30
New cards

What are stacks in Data structures?

a LIFO data structure

31
New cards

peek()

returns the top value of the stack

32
New cards

what is stack overflow

error when attempt to push an item to a full stack

33
New cards

push(item)

adds a new item to the top of the stack

34
New cards

stack underflow

pop item from empty stack

35
New cards

applications of stacks

holding parameters, local variables, holding return addresses

36
New cards

what is a priority queue ?

allows items to be added at a specific point in a queue

37
New cards

applications of a linked list

os process block storage, image viewers, web browsers, hash table collision, file allocation.

38
New cards

what is a hash table?

a table which uses hash functions on data values to determine the address in the hash table to store that value

39
New cards

what is a collision hash table

two values produce the same hash value

40
New cards

how can collision values be reduced

increase the size of the hash table, use better hashing function