Data Structures Interview Questions.

Slides:



Advertisements
Similar presentations
SEG4110 – Advanced Software Design and Reengineering TOPIC J C++ Standard Template Library.
Advertisements

CS252: Systems Programming Ninghui Li Program Interview Questions.
CS50 WEEK 6 Kenny Yu.
Data Structures, Search and Sort Algorithms Kar-Hai Chu
Main Index Contents 11 Main Index Contents Model for a Queue Model for a Queue The Queue The Queue ADTQueue ADT (3 slides) Queue ADT Radix Sort Radix Sort.
Review for Test 2 i206 Fall 2010 John Chuang. 2 Topics  Operating System and Memory Hierarchy  Algorithm analysis and Big-O Notation  Data structures.
Dr. Andrew Wallace PhD BEng(hons) EurIng
Heaps and heapsort COMP171 Fall 2005 Part 2. Sorting III / Slide 2 Heap: array implementation Is it a good idea to store arbitrary.
Java Collections. Collections, Iterators, Algorithms CollectionsIteratorsAlgorithms.
Copyright © Wondershare Software Introduction to Data Structures Prepared by: Eng. Ahmed & Mohamed Taha.
1 Hash Tables  a hash table is an array of size Tsize  has index positions 0.. Tsize-1  two types of hash tables  open hash table  array element type.
Chapter 9 (modified) Abstract Data Types and Algorithms Nell Dale John Lewis.
Review for Final Andy Wang Data Structures, Algorithms, and Generic Programming.
9-1 Abstract Data Types Abstract data type A data type whose properties (data and operations) are specified independently of any particular implementation.
Standard Template Library The Standard Template Library was recently added to standard C++. –The STL contains generic template classes. –The STL permits.
Elementary Data Organization. Outline  Data, Entity and Information  Primitive data types  Non primitive data Types  Data structure  Definition 
Review for Final Exam – cs411/511 Definitions (5 questions, 2 points each) Algorithm Analysis (3 questions, 3 points each) General Questions (3 questions,
Data Structure II So Pak Yeung Outline Review  Array  Sorted Array  Linked List Binary Search Tree Heap Hash Table.
Data Structures for Midterm 2. C++ Data Structure Runtimes.
STL – Standard Template Library L. Grewe. 2 Goals Lots of important algorithms, data structures in CS using Templates. is a software library partially.
C++ Review STL CONTAINERS.
CSCI 383 Object-Oriented Programming & Design Lecture 25 Martin van Bommel.
Week 15 – Monday.  What did we talk about last time?  Tries.
Final Exam Review COP4530.
Recitation 9 Prelim Review.
Data Structures and Algorithms
Set Collection A Bag is a general collection class that implements the Collection interface. A Set is a collection that resembles a Bag with the provision.
Regarding homework 9 Many low grades
Course Developer/Writer: A. J. Ikuomola
Data Structure Interview Question and Answers
Searching – Linear and Binary Searches
Chapter 15 Lists Objectives
Recitation 10 Prelim Review.
Priority Queues and Heaps
Lecture 15 AVL Trees Slides modified from © 2010 Goodrich, Tamassia & by Prof. Naveen Garg’s Lectures.
Cinda Heeren / Geoffrey Tien
Week 15 – Monday CS221.
Hashing Exercises.
abstract containers sequence/linear (1 to 1) hierarchical (1 to many)
Data Structures and Algorithms
Map interface Empty() - return true if the map is empty; else return false Size() - return the number of elements in the map Find(key) - if there is an.
What remains Topics Assignments Final exam
structures and their relationships." - Linus Torvalds
Stacks Linked Lists Queues Heaps Hashes
structures and their relationships." - Linus Torvalds
Fundamentals of Python: From First Programs Through Data Structures
Heapsort Heap & Priority Queue.
Counting (Pigeon Hole)
Final Exam Review COP4530.
Chapter 21 Hashing: Implementing Dictionaries and Sets
- Alan Perlis Topic 24 Heaps "You think you know when you can learn,
ITEC 2620M Introduction to Data Structures
Lesson 6. Types Equality and Identity. Collections.
CSE 214 – Computer Science II B-Trees
Heap Sort CSE 2011 Winter January 2019.
Data structures and algorithms
Fundamentals of Python: From First Programs Through Data Structures
Algorithms: Design and Analysis
EN Software Carpentry Python – A Crash Course Data Structures.
Recitation 10 Prelim Review.
STL (Standard Template Library)
CSE 373, Copyright S. Tanimoto, 2002 Priority Queues -
C++ Programming: chapter 10 – STL
OPIM 915 Fall 2010 Data Structures 23-38,
Linked List Intro CSCE 121.
EECE.3220 Data Structures Instructor: Dr. Michael Geiger Spring 2019
CS 240 – Advanced Programming Concepts
structures and their relationships." - Linus Torvalds
Abstract Data Types (ADTs)
Standard Template Library
Presentation transcript:

Data Structures Interview Questions

C++ Data Structure Runtimes Insert Find Delete vector O(n) O(1) amortized O(1) if index is known sorted vector O(log(n)) linked list (list, stack, queue) O(1) *Given an Iterator balanced binary tree (map, set) hash table (unordered_set, unordered_map) Heap (priority_queue) N/A O(1) to find min

Common Interview Questions *These types of questions will not be on the final exam Find the middle element of a linked list in one pass. What if the list has a cycle? Detect a cycle in a linked list.

Common Interview Questions *These types of questions will not be on the final exam Given an array of size 100 containing one copy each of the integers 1-100 with exactly one integer being repeated once, find the repeated integer. Given an array of arbitrary integers, find all integers that appear exactly twice.

Common Interview Questions *These types of questions will not be on the final exam Implement a stack that can also give the minimum element in the stack at any given time. push, pop, and min must all run in O(1) time.

Common Interview Questions *These types of questions will not be on the final exam In class we described a stack that was implemented as a linked list. How could we implement a stack as a vector? How could we use a single vector to implement 3 stacks?

Common Interview Questions *These types of questions will not be on the final exam Give a function that will sort a vector of string such that all the anagrams are next to each other, ignoring spaces. Two words are anagrams of each other if they use exactly the same letters ex. “interpreter” and “enter err pit”