Git Product home page Git Product logo

ece3314-datastructure's Introduction

ECE3314-DataStructure

Refer to 'Fundamentals of Data Structure in C' 2/E (Horowitz, 2008, Sillicon Press) (ISBN:9780929306407)

Fundamentals of Data Structure in C

Index

  1. C Language Review (Array, Pointer, Structure)
  2. Introduction: Algorithm and Data Organization
  3. Arrays
  4. Stacks and Queues
  5. Linked Lists
  6. Trees
  7. Graphs
  8. Internal Sorting
  9. External Sorting
  10. Hashing

Development Environment

Operating System    : Ubuntu 20.04.4 LTS
Compiler            : gcc 9.3.0
Build/Host/Target   : x86_64-linux-gnu

Requirements

sudo apt install build-essential    # including gcc, g++, standard libraries and make
sudo apt install gdb                # GNU Debugger

Makefile

CC = gcc
ifeq ($(RELEASE),1)         # Command "make RELEASE=1" for Release Build
CFLAGS = -O2 -DNDEBUG -c
LDFLAGS = -O2 -DNDEBUG -o
else                        # Command "make" for Debug Build
CFLAGS = -c -g -O0 -DDEBUG -W -Wall
LDFLAGS = -O0 -DDEBUG -W -Wall -o
endif
SRCS = $(notdir $(wildcard *.c))
OBJS = $(SRCS:.c=.o)
TARGET = a.out              # Set the name of executable output file
 
$(TARGET): $(OBJS)          # Linking object file w/ dynamic library
	$(CC) $(LDFLAGS) $(TARGET) $(OBJS)

%.o: %.c %.h                # Compile C source w/ header file
	$(CC) $(CFLAGS) $<

run:                        # Command "make run" to execute generated output.
	./$(TARGET)

clean:                      # Command "make clear" to remove all the intermediate and output file.
	rm *.o $(TARGET)

Assignment

Submit compressed zip file including:

  1. Source Code file(w/ appropriate comment as shown example below)

  2. Report in docx or hwp format that includes:

    • captured image of executed result in terminal windows
    • explanation or analysis of algorithm
      • time complexity
      • space complexity

Comment Example

  1. File Head Comment
/*********************************************************************
 * File Name            : main.c
 * Author               : Kang, Jun Gu
 * Student ID           : 1218XXXX
 * Date                 : 2022.02.28
 * Operating System     : Ubuntu 20.04.4 LTS
 * Compiler             : gcc 9.4.0
 * Build/Host/Target    : x86_64-linux-gnu
 *********************************************************************
 * version      : 1.0.0
 * description  : ...
 * etc...
 *********************************************************************/
  1. Function Head Comment
/*********************************************************************
 * TMatrix :: _InsertNode
 * description....
 *********************************************************************
 * Input    : Node* (Insert node)
 *            Node* (Column node before insert node)
 *            Node* (Row node before insert node)
 * Output   : int   (1: success)
 *                  (0: fail) 
 *********************************************************************/
  1. Inline comment
/*****************************Row insert*****************************/
    if(pRowPos->pNextRow != pRowPos) {
        pTemp->pNextRow = pRowPos->pNextRow;        // pTemp set next row
        if(!(pRowPos->pNextRow->bHead)){
            pRowPos->pNextRow->NodeItem.pPrevRow = pTemp;
        }                                           // end of if
    }                                               // end of if
    else
        pTemp->pNextRow = pRowPos;                  // pTemp set next row
    
    pTemp->NodeItem.pPrevRow = pRowPos;             // pTemp set previous row
    pRowPos->pNextRow = pTemp;
/**************************End of row insert**************************/

Report Example

  1. Algorithm - pseudo code
FixHeap(Node *root, Key k){
    Node vacant, largerChild;
    vacant = root;
    while( vacant is not leaf ) {
        largerChild = the child of vacant with the larger key;
        if( k < largerChild’s Key ) {
            copy lagerChild’s key to vacant;
            vacant = largerChild;
        }
        else exit loop;
    }
}
  1. Algorithm - Flow Chart (Each function)

sample_flowchart.svg

Draw flow chart at draw.io

ece3314-datastructure's People

Contributors

fennecfox38 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.