Back to marketplace

fundamentals of data structures

No description yet. This curated deck is ready for daily study.

Total cards: 24•Content version: v4•Public deck•Updated: 8/1/2026

Card preview (24)

#1
Front (Question)

data structure

Back (Answer)

the arrangment of data

#2
Front (Question)

one dimensional array

Back (Answer)

stores data in one direction useful way of representing a vector

#3
Front (Question)

two dimensional array

Back (Answer)

stores data horizontally and vertically useful way of representing a matrix example: triplets = [[a,b,c], [d,e,f], [g,h,i]] triples[2,1] = h

#4
Front (Question)

binary files

Back (Answer)

formatted so only one a program can read them

#5
Front (Question)

text files

Back (Answer)

contain characters structured as lines of text

#6
Front (Question)

why files must be closed

Back (Answer)

closing free up resources, preventing corruption and ‘flushes’ the buffer

#7
Front (Question)

record

Back (Answer)

usually for a single entity heterogenous

#8
Front (Question)

subprogram

Back (Answer)

an ‘out of line’ block that performs a specific task (can be ither user written or pre existing)

#9
Front (Question)

how can subprogram be used

Back (Answer)

by calling their name in a statement causing them to be executed

#10
Front (Question)

how can data be passed in to a sub routine

Back (Answer)

through parameters (variables used for the input to the subroutine)

#11
Front (Question)

two types of subprograms

Back (Answer)

procedure (doesn’t return a value) functions (returns a value

#12
Front (Question)

structured programming

Back (Answer)

improves the quality and clarity of code

#13
Front (Question)

pros for structured programming

Back (Answer)

code is more readable and easier to understand easier to test modules can be reused

#14
Front (Question)

steps in adding a record to a hash table

Back (Answer)

• apply hash function to calculate the hash value for the key . • use the hash value to find the index in the hash table so that the new record could be stored. • check if there is a record at the index. if yes, use a collision resolution technique. • insert the new record at the index in the hash table and update the number of records in the hash table.

#15
Front (Question)

two components of a stack frame

Back (Answer)

local variables and parameters

#16
Front (Question)

operation of a stack frame and test whether if empty or full

Back (Answer)

• initialize an empty stack • push values onto a stack from left hand side. • for each number in the expression; push it onto a stack. for each operator; pop the top two numbers off the stack. • after both have been processed, the stack should contain only one value, which is the result of the expression. • check if empty by comparing the stack pointer to the initial address of the stack • check if full by comparing the stack pointer to the max address of the stack

#17
Front (Question)

Describe the method that would need to be followed to attempt to remove an item from a queue

Back (Answer)

• check if the queue is empty by comparing the front and rear pointer. if equal, the queue is empty and no item can be removed. • if not empty, remove the front item from the front of the queue. • update the front pointer to the next item in the queue. if the front pointer exceeds the size of the array, reset it to 0. • reduce the count of items in the queue by 1

#18
Front (Question)

Describe the method that would need to be followed to attempt to add an item to a queue

Back (Answer)

• Check if the number of elements in the queue is equal to the maximum capacity. If it is, the queue is full. • If it is not full, increment the count of elements in the queue. Insert the item at the next available position in the queue. • Check if the number of elements in the queue is equal to the maximum capacity. If it is, the queue is full. If it is not full, return false or display an appropriate message.

#19
Front (Question)

three differences between dynamic and static data structures

Back (Answer)

static data structures memory are allocated at compile time/dynamic data structure memory are allocated at run time. static data structure size is fixed and cannot change during runtime/ dynamic data structure size can be changed during runtime static data structure memory is managed by compiler/ dynamic data structure memory is managed by the programmer

#20
Front (Question)

explain how a single stack can be used to reverse the order of the items in a queue

Back (Answer)

• deque all the items from the queue and push them onto the stack • pop them off one by one and enqueue them back into the original queue • the order of the items in the queue will be reversed

#21
Front (Question)

when does collision occur

Back (Answer)

when two key values compute the same hash.

#22
Front (Question)

dictionary

Back (Answer)

A collection of key-value pairs in which the value is accessed via the associated key.

#23
Front (Question)

application of dictionaries

Back (Answer)

information retrieval

#24
Front (Question)

what does vector addition and multiplication achieve

Back (Answer)

addition achieves translation and multiplication achieves scaling.