Flashcards
13: Data Types and Structures
Flashcards do conjunto (25)
- 1What are primitive data types?variables that cna be defined simply by commands built into the programming language (atomic data types)
- 2Give 4 exampeles of privitve data types and 2 furhter daya typesInteger Real boolean char
further: string, data - 3What is a integer, real, char, string, boolean, data?signed whole number
signed number with decimal point
single character
sequence on 0 or more characters
logical values true and false
dat, moneth, year sometimes time - 4Describe the record typecomposite type: logical group of different data types - user-defined type
- 5How write record type in pseudecode?TYPE ___
DECLARE ___: ____
ENDTYPE - 6Array IndexRow or colomn number of an individual array element.
- 7Upper BoundThe highest number index of an array dimension.
- 8Lower BoundThe smallest number index of an array dimension.
- 9What is an array?ordered set of data itmes, usually of same type, grouped together with single identifier
- 10Linear SearchChecking each element of an array in turn for a requred value.
- 11Bubble SortA sort method where adjacent pairs of values are compared and swapped.
(sorting in 1d array compare 1st and 2nd if 2nd bigger swap, repeat, repeat) - 12Declare a 1d array in pseudecodeDECLARE ___ : ARRAY[ : ] of __
- 13Declare a 2d array in pseudecodeDECLARE ___: ARRAY[ : , : ] of (datatype)
# rows given first then clomus, lower and upper bounds - 14Textfiles: writing to a text file in pseudecode read appendOPENFILE ___ FOR WRITE
WRITEFILE ____, ______
CLOSEFILE ____
OPENFILE ___ FOR READ
READFILE ____, ______
CLOSEFILE ____
OPENFILE ___ FOR APPEND
WRITEFILE ____, ______
CLOSEFILE ____ - 15redad a text file and ouput contents in pseudecodeOPENFILE "_.txt" FOR READ
WHILE NOT EOF("_.txt") DO
READFILE "_.txt", TextString
OUPUT TextString
ENDWHILE
CLOSEFILE "_.txt" - 16Abstract Data Type ADTsA collection of data with associated operations
- 17What are the associated perations of ADTs 5- create a new instance of the data structure
- find an element int eh data strucutre
- insert a new element into the data strucutre
-detele an element from data strucutre
-access all elements stored in teh data structure in a systematic manner - 18Give 3 examples of ADTsstack
queue
linked list - 19Describe stacksitem accessible at top of stack. Bse of stack Pointer - first slot in stack
TopofStack Pointer - last item pushed onto stack
DECLARE Stack: Array[0:7] of CHAR - 20Describe queuesfront position - . circular quese- wrap around
- 21NodeAn element of a list.
- 22PointerA varaible that stores the address of the node it points to.
- 23Null PointerA pointer that doesn't point to anything.
- 24Start PointerA varaible that stores the address of the first element of a linked list.
- 25Describe linked lists: to detlet adv over linear lists, disto delete - set before pointer field to null pointer. Add start pointer copied into new point.
Prefereable to linerar lists - when need reordering only points need changing unlike linear - all data itmes need to be moved - saves time
Dis - needs more storage space for pointer fields
Informações
- Descrição
- A Level AS Computer Science (Unit 2: Fundamental Problem-solving and Programming Skills) FlashCards sobre 13: Data Types and Structures, criado por HRYN red em 11-05-2017.
- Criado por
- HRYN red · mai 2017
- Atualizado
- 10 mar 2023
- Visualizações
- 26
- Avaliação