返回卡包市场

fundamentals of data structures

暂无描述。系统推荐的高质量记忆内容,适合每天坚持背诵学习。

卡片总数: 24内容版本: v4公开卡包更新时间: 8/1/2026

卡片预览 (24 张)

#1
正面 (问题)

data structure

背面 (解答)

the arrangment of data

#2
正面 (问题)

one dimensional array

背面 (解答)

stores data in one direction useful way of representing a vector

#3
正面 (问题)

two dimensional array

背面 (解答)

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
正面 (问题)

binary files

背面 (解答)

formatted so only one a program can read them

#5
正面 (问题)

text files

背面 (解答)

contain characters structured as lines of text

#6
正面 (问题)

why files must be closed

背面 (解答)

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

#7
正面 (问题)

record

背面 (解答)

usually for a single entity heterogenous

#8
正面 (问题)

subprogram

背面 (解答)

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

#9
正面 (问题)

how can subprogram be used

背面 (解答)

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

#10
正面 (问题)

how can data be passed in to a sub routine

背面 (解答)

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

#11
正面 (问题)

two types of subprograms

背面 (解答)

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

#12
正面 (问题)

structured programming

背面 (解答)

improves the quality and clarity of code

#13
正面 (问题)

pros for structured programming

背面 (解答)

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

#14
正面 (问题)

steps in adding a record to a hash table

背面 (解答)

• 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
正面 (问题)

two components of a stack frame

背面 (解答)

local variables and parameters

#16
正面 (问题)

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

背面 (解答)

• 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
正面 (问题)

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

背面 (解答)

• 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
正面 (问题)

Describe the method that would need to be followed to attempt to add an item to a 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, 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
正面 (问题)

three differences between dynamic and static data structures

背面 (解答)

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
正面 (问题)

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

背面 (解答)

• 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
正面 (问题)

when does collision occur

背面 (解答)

when two key values compute the same hash.

#22
正面 (问题)

dictionary

背面 (解答)

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

#23
正面 (问题)

application of dictionaries

背面 (解答)

information retrieval

#24
正面 (问题)

what does vector addition and multiplication achieve

背面 (解答)

addition achieves translation and multiplication achieves scaling.