CHAPTER 1 Flashcards

1
Q

INTRODUCTION/DEFINATION TO DATA STRUCTURE

A
  • A DATA STRUCTURE IS THE LOGICAL ARRANGMENT OF DATA ELEMENT COMBINE WITH SET OF OPERATIONS THAT HELPS WITH ACCESS THE ELEMENTS
  • SOME OF THE MORE COMMONLY USED DATA STRUCTURE ARE LINKLIST , ARRAY , TREE, QUEUE
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

TYPES OF DATA STRUCTURE

A

PRIMITIVE AND NON PRIMITIVE

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

EXAMPLE : PRIMITIVE

A

INT

FLOAT

DOUBLE

CHAR

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

TYPES OF NON PRIMITIVE WITH EXAMPLES

A

LINEAR AND NONLINEAR
LINEAR : ARRAY , STACL
NONLINEAR : GRAPH , TREE

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

ADVANTAGES & DISADVANTAGES OF POINTER

A

IT ALLOW YOU TO ACESS ANY MEMORY ADDRESS
- * Pointers can be used to return multiple values from a function.
- * Pointers allow C to support dynamic memory management.

  • DISADVANTAGES OF POINTER
    • IF POINTER REFREANCE INCORRECT VALUE IT EFFECT WHOLE PROGRAM
    • POINTERS ARE SLOWER THAN NORMAL VARIABLESADVANTAGES & DISADVANTAGES OF POINTER
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

COMPLEXITY

A

complexity is ameasure of the interactions of the various elements of the software

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

2 TYPES OF COMPLEXITY

A

TIME COMP;EXITY , SPACE COMPLEXITY

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

TIME COMPLEXITY

A
  • MOUNT OF COMPUTATIONAL TIME NEED TO EXECUTE THE PROGRAM AND GET THE INTENDED RESULT
    • THERE ARE 3 COMPLEXITY ANALIZIES
      1. WORST CASE > BIG OH = O
      2. AVERAGE CASE > THETA =0( THETA)
      3. BEST CASE > OMEGA = (SIGN OF OHM )
      • WORST CASE : BIG OH USES FOR WORST CASE & RESULT GETS IN UPPER BOUND
      • AVERAGE CASE : THETA NOTATION USE FOR AVERAGE CASE AND RSULT GETS TIGHT BOUND
      • BEST CASE : OMEGA NOTATION USE FOR BEST CASE , SO ON RESULT GETS WITH LOWER BOUND
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

SPACE COMPLEXITY

A

e space complexity of an algorithm or a computer program is theamount of memory space required to solve an instance of the computational problem

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Algorithm

A

is a finite sequence of well-defined, computer-implementable instructions, typically to solve a class of problems

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

USES OF ALGORITHM (OR BENIFIT OF ANALYZE ALGORITHM )

A
  • TO PREDICT REQUIRED RESOURSES
  • TO PREDICT HOW FAST ALGORITHM WORK BASE ON PROBLEM SIZE
  • TO KNOW COMPUTATIONAL TIME AND CPU CONSAMPTION
  • TO KNOW MEMORY AND RAM CONSAMPTION
  • TO PREDICT DESIGN AND CODE STRUCTRE
  • TO MAKE CODE EASY TO UNDERSTAND
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

WHAT IS STACK?

A

A STACK IS A LINEAR DATA STRUCTURE WHICH STORES ITS ELEMENTS IN PARTICULAR ORDER. THIS ORDER FOLLOWED BY A STACK IS KNOWN AS LIFO (Last In Frist Out )

  • A EXAMPLE OF REAL LIFE IS PLATES STACKED OVER ONE ANOTHER ON A TABLE
  • THE PLATE WHICH IS AT THE TOP IS THE FIRST ONE TO BE REMOVED
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

PROPERTIES OF STACK

A
  1. FOLLOWS LIFO , LAST ELEMENT THAT IS INSERTED IS PUSHED OUT FIRST
  2. A POINTER KEEPS TRACK OF THE STACK’S TOPMOST (OR LAST) ELEMENT . THIS IS MANIPULATED ON THE BASIS OF OPERATIONS TO KEEP TRACK OF MOST RECENT ELEMENT
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

STACK MANIPULATION OPERATIONS

A
  • PUSH OPERATION
    • WHEN AN ELEMENT IS INSERTED INTO THE STACK , IT IS SAID THAT THE ELEMENT IS PUSHED INTO STACK , THE TIP POINTER IS MOVED UP TO POINT TO THE ELEMENT THAT IS INSERTED
  • POP OPERATION
    • WHEN AN ELEMNT IS REMOVED FROM THE STACK, IT IS SAID THAT THE ELEMENT IS POOPED FROM THE STACK , THE TOP POINTER IS MOVED DOWN TO POINT TO THE ELEMENT BELOW THE REMOVED ELEMENT
  • PEEK OPERATION
    • PEEK IS AN OPERATION THAT RETURNS THE VALUE OF THE TOPMOST ELEMENT OF THE STACK WITHOUT DELETING IT FROM STACK.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly